How can I show a three to four line title in a WKInterfaceButton?
I tried setting the size to fit content but it only shows a maximum of two lines for the title.
So you want multiline actionable text in your storyboard.
For now we can not make the multiline title of the WKInterfaceButton. But there is another work around that is helpful and recommended by Apple too.
Change the Content type of the WKInterfaceButton from Text to Group.
Make sure its height is "Size To Fit Content".
Now Add a WKInterfaceLabel in this Group. Make this Label's proper IBOutlet Connection. Put your Title actionable Text in this Label. Make sure Label's height is "Size To Fit Content" too.
For people 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. These properties aren't visible in code for some reason.
Related
I am beginner in iOS app development, I am working on a project that was done by someone else. So my problem is the label is not fully showing its contents:
check the second column under 'customer name'.
I did some basic alterations to the label but it makes no change at all. This is a collection view, there is another view inside the collection view cell which holds the title label and description label.
I searched everywhere but didn't get any proper answer please help.
Label in iOS does not change its size to suit the contents, you need to adjust it in your code. Your options are either decrease the font size to suit the description label size, or adjust the description label's height/width to make room for current content. I'd do a combination of both (slightly reducing the font size of the label's text, and at the same time making all the cells a bit wider and taller).
Oh, there is also a way to automatically shrink the font size if the contents doesn't fit the space. So, you'd need to check the option for your description label. Here's how you might do it: how to make UILabel autosize text in storyboard (or interface builder), NOT programmatically
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.
hello all i have new in watchkit development and i have special requirement in which i arrange one WKInterfaceLabel below another WKInterfaceLabel, i try with lots off option like edit postions but WKInterfaceLabel is not set properly can you please help me in this.
1)Position of the first WKInterfaceLabel
2) Position of the second WKInterfaceLabel
3) Actual Design
4)Display in Interface file
I don't know clearly about your question, but if you want to arrange the label as you want, you should use the Group and change the position, size of width, and height of label.
In your displayInterface File, may be you have one Label out side of your interface. you can change the vertical or horizontal arrange element of group if you want at attribute Window at the right side of Xcode
I hope you are adding both WKInterfaceLabel vertically in WKInterfaceGroup. Set vertical position of both labels as Top.
This is my first IOS app, just for training, and I got some issue with Label ,check the image
As you can See Object: Photo- Visualizing the Thomas Walther is not properly shown and some words are missing.
So How to fix it and make the string appears on multiLines if it's too long?
In your storyboard, select the UILabel and open the Attributes Inspector (in the utilities, which can be opened with the shortcut opt-command-4). You can change all the the basic properties of the UILabel here.
For multiple lines, ensure that the label height is large enough and set the Lines to 0. You can also change the font scaling in the Autoshrink property (default is fixed font size).
I can't really tell from your screenshot, but you may have some Auto Layout issues with the width of your label to the right side of the window. So you may want to look into setting Auto Layout constraints as well.
I have UILabel in interface builder like this (creating text and use Cmd + =)
but when i run the program on emulator or real device, it looks like this
the answer from here can solve my issue but it isn't the best way because i don't want to create all my label as an IBOutlet for calling sizeToFit and i also don't want to scale down my text.
is there any way to display text in the device as it shows in interface builder without additional code or configuration?
Thanks
If you're just strictly not wanting to do any of it in code, simply press Editor -> Size to Fit Content when you have the label selected in IB.
Select your label in the interface builder, and then in the utility area found on the right hand side, go to the "Size Inspector", look for this icon -->
In there you will see options to set your label's origin, width and height
Increase the "width" of your label and that should fix your problem