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

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

问题描述

我的WKInterfaceLabel中的文本太长,导致文本被切掉并在末尾加点.我知道,对于iOS的UILabel,您可以通过启用剪辑模式轻松解决此问题.我不认为我有任何办法可以解决此问题.如果无法防止文字被截断,这将迫使我使用图像.任何提示或建议,不胜感激.

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,并且将缩放比例设置为.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天全站免登陆