UILabel doesn't show text properly - ios

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

Related

Static width in text field

please how can i have a static width for my Text Fields.
I have a Login View Controller (portrait) in which i have an image (logo of the App), username text field, password text field and a button to log in.
When i run it in an Iphone it looks pretty good, but in Ipad all looks stretched.
What can i do so this elements looks the same in both devices? (i want them to look as the Iphone shows).
I don't want them to resize.
Thanks a lot!
If you want an element to be an exact size you would update the width and height constraints to be your desired number.
Set your textFields width and height properties to your desired size in Attributes inspector panel or do it programmatically.
I would recommend you to use Auto Layout as that will help you make your design beautiful in all resolutions and sizes.
Thanks all for your answer, i erase the "Leading space to container" and "Trailing space to container" in each one of the elements.
It is no resizing anymore :)

WKInterfaceButton multiple line title

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.

How to put one WKInterfaceLabel below WKInterfaceLabel?

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.

Xcode Label with long Text not properly shown

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.

Why does the label control element does not wrap onto multiple lines after I select that option

I have a long label that spans multiple lines and I can not get it to wrap the text. I selected 5 lines and wrap-text option, but for some reason it is not happening. Any idea how to do that? :)
I am attaching the screen shot.
When you paste text into a label, interface builder automatically makes it wide enough to accomodate the text. Just resize your label to a smaller width; easiest to do in the size inspector on the right (the ruler icon). Try a width of 300px.

Resources