UILabel 使用剪辑渲染部分字符
我希望 UILabel 通过将 lineBreakMode 设置为 Clip 来渲染部分字符。但它正在剪辑整个角色。是否有不同的方法来剪辑单词以便仅显示部分字符?
假设我有一个像
“Hello Word”这样的字符串,并且该字符串位于 myLabel 中,其宽度仅适合 5 个字符和“W”的一部分,我希望它仍然呈现“W”的一部分而不是丢弃它来自渲染。
I want a UILabel to render a partial character by setting the lineBreakMode to clip. But it is clipping the entire character. Is there a different way to clip a word so that only partial character is displayed?
Lets say I have a string like:
"Hello Word" and that string is in a myLabel with a width that only fits the 5 characters and part of the "W" I want it still to render part of the "W" and not drop it from the render.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我怀疑你必须将字符串渲染成图像并剪辑它。
I suspect you'd have to render the string into an image and clip that.