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.
Related
I'm creating an app with quite a lot of text. It will be of variable size, so I was wondering if there is a way to adapt my ScrollView to the size of the UILabel, not knowing in the IB what will be the number of lines of that label. I'm doing it from the IB, drag n dropping it, then I'm putting 4 elements inside : an image for the logo, a title, another image, and then the label.
My question is : how can I tell my ScrollView to adapt to the text ? With constraints ? In the code ? I'm sooooo lost with that scrolling thing…
I think I need a very very good tutorial about autolayout…
Here's some screenshots of my project
The project on simulator
The layout
Thanks a lot!
You have to add the constraints to your label so that it will always have the same spacing to the scroll view. Also, you will have to set your labels lines to 0.
Don't press Add Missing Constraints because it will probably set your height and you don't want that to happen. Use the Pin button to set the spacing to nearest neighbor.
These are the buttons you will have to use, they are bottom right.
First of all, press the one in the right and select All Views > Clear Constraints.
Then, select your label in the storyboard and press the button with a square Pin, here you will have to select everything until you have something like this with different values... Also click in the red lines so that you get a continuous red line. Don't check any of the boxes you see.
After this, you have to do the same process for your Scroller.
It should be enough. I will also need to know where your scroller is.
If you have anything else in your view, do the same.
I'm making an app in which I add people to a list by using a modal VC, that currently has only three text fields.
Problem:
This is what I see in the interface builder, inside my Main.storyboard file:
I'm running Xcode version 6.2 (6C131e) and the app I'm making will be for iPod touch only, so I disabled auto-size classes. I'm expecting those text fields to be at the center of the screen (same distance from text field lateral border to screen edges). Instead I get this on the simulator:
Question:
How can I set an equal distance for both the sides of text fields? Any resource like tutorials, examples, guides are appreciated, because I am a very beginner in iOS programming. If this can be done with interface builder for me is better then programmatically.
As simple as this:
In the Align menu from the bottom of interface builder if you set this constraint to 0 it will be the center of the view
Select First Textfield
Goto Pin-> Uncheck constraints to Margin-> Select Top,Left,right constraints with default value(or change if want ex. 16 left,right,30 top).
For Second and Third Textfield
Goto Pin->Uncheck constraints to Margin->Select Top,Left,right constraints
If you are not using Autolayout then the default Autoresizing property should be
Change the Autoresizing property to this :
Check this question : Any other method to resize views, other than Auto-layout
I just take horizontally as example. You have two ways to make it in the centre.
1. Make leading space equals trailing space.
Make the textfield center horizontally in container view.
I recommend you can study with raywenderlich tutorial.
http://www.raywenderlich.com/50317/beginning-auto-layout-tutorial-in-ios-7-part-1
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.
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.
I have 3 labels .First one at the top of the screen, second in the middle and third below. I used both( size class(cW rH)+ autolayout)to layout the labels.The third label appears in all sizes expect the 3.5inch screen. Can autolayout and/or size class help me accommodate my third label in some way?.I know putting a scroll view or doing programatically will help me achieve what i want but just want to know whether the current iOS SDK is intelligent enough to cut this.
You have to use different constraint for each label.
Please check below screenshot to understand how to set constraint to each label.
May be it will help you to set labels.
I have Submit label as third label and I did following for it . Try using it and dont forget to click add constraint after doing it