简体   繁体   中英

Watchkit Multi-line label with Top Aligment

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

屏幕在右侧显示多行标签,但文本垂直居中,而不是顶部对齐

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 .

在此处输入图片说明

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM