如何让一个视图支持纵向和横向
我的应用程序中有一个视图,上面有很多文字。
重要的是,本文的写作应保持在“一行”内。
问题是有时每行的长度都会改变,导致文本尺寸缩小。
那么我怎样才能让这个视图也支持景观呢?
I have one view in my app that has a lot of writing on it.
It's important that this writing stay in the "one lines" that it is.
The problem is sometimes each line changes length causing the text to scale down in size.
So how would I make this view also supporg landscape?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您有三种选择:
1) 让文本跨越一行以上
2) 截断文本而不是缩放文本
3) 接受文本将缩放。
您已经在问题中说过您不想要(1)或(3),因此您需要执行选项(2)。
您可以通过在标签上设置此项来关闭文本缩放:
并选择您希望如何截断文本,例如:
将从标签中心修剪,即“This_is_..._text” - 它会添加 ..为您而不是缩放文本。
You have three choices :
1) Let the text span more than one line
2) Truncate the text instead of scaling it
3) Accept that the text is going to scale.
You've already said in your question that you don't want (1) or (3) so you need to do option (2).
You can turn off text scaling by setting this on your label :
and choose how you want the text to be trucated, for example this :
will trim from the center of your label i.e. 'This_is_..._text' - it adds the ... for you instead of scaling the text.