iWatch:WKInterfaceLabel 是否可以阻止文本被“..."截断?在标签的末尾? [英] iWatch: WKInterfaceLabel is it possible to stop text from being cut off with "..." at the end of a label?

查看:25
本文介绍了iWatch:WKInterfaceLabel 是否可以阻止文本被“..."截断?在标签的末尾?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 WKInterfaceLabel 中的文本太长,导致文本在末尾被截断并带有点.我知道对于 iOS 的 UILabel,您可以通过启用剪辑模式轻松解决此问题.我不相信有任何方法可以为 watchkit 解决这个问题.如果我无法阻止文本被截断,这将迫使我使用图像.任何提示或建议表示赞赏.

The text in my WKInterfaceLabel is way too long and causes the text to be cut off with dots at the end. I know for UILabel for iOS you can easily resolve this issue by enabling clip mode. I don't believe there is any way for me to resolve this for watchkit. This is going to force me to use an Image if I can't prevent the text from being cut off. Any tips or suggestions is appreciated.

推荐答案

您有几个选项,具体取决于您希望视图如何响应.在您的界面故事板中选择您的标签并打开属性检查器.

You have a couple options depending on how you want the view to respond. In your interface story board select your label and open the attributes inspector.

您的第一个选择是将字体更改为较小的尺寸.这更适用于您想要设置样式并保留设置的静态标签.

Your first option is to change the font to a smaller size. This is more for a static label that you want to style and leave set.

您的第二个选项是调整最小比例值,更改此值将自动缩小文本以适应窗口,直至达到提供的值.例如,如果您的字体大小为 12pt 并且您将比例设置为 0.5,则在附加省略号 (...) 之前,字体将缩小至 6pt.

Your second option is to adjust the min scale value, changing this will automatically shrink the text to fit the window up to the value provided. For example if your font size is 12pt and you set the scale to .5, the font will shrink up to 6pt before appending the ellipsis (...).

您的第三个选项是将行数设置为 0(或更高的数字).这会将文本向下移动到下一行.

Your third option is to set the number of lines to 0 (or a higher number). This will move the text down onto the next line.

这篇关于iWatch:WKInterfaceLabel 是否可以阻止文本被“..."截断?在标签的末尾?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆