Watchkit Multi-line label with Top Aligment

人盡茶涼 提交于 2020-02-06 03:16:12

问题


Want to add a multi-line label to a tablerowcontroller with top alignment. The only alignment options are left/right etc. Looks like it automatically centers the text vertically. Anyway to force top alignment? Using iOS8/Xcode 6.3.2


回答1:


Table Row Controller is a Group. You can change the Group Layout to Vertical.

You can also insert a Group into another Group, and control individual layout. Nested groups can help you to fine-tune the layout you desire:

Nest a vertical group into the horizontal group to handle the label under the icon. Set the Position of the multiple lines label to left & top.




回答2:


For anyone using Xamarin, right-click on your storyboard file, and open it in Xcode Interface Builder. Click on the the label, and set the "Lines" property to 2 (or more). And make sure the size of it is set to "Size to fit content", same with any parent container/group.



来源:https://stackoverflow.com/questions/31352690/watchkit-multi-line-label-with-top-aligment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!