Thursday, February 26, 2015

iOS 8.0 Auto layout learning

For this demo, the project is named SizeClassDemo and it does not remove the size class property. 
Dragged and dropped a label and two button on the main story board which also uses the size classes. 
This looked fine in the story board, but previewing on the various screen resolutions, the right buttons did not quite look good. 
Also dragged a button and a text view. The view looked like below 

Now selecting the Label, pressed on the I beam 

Few notes from experience while doing this are:
- We can see all the constraints added to a UI component using the second right button on the right side tool area
- We can see that by default, the story board considers the status area and leaves that and in landscape mode, it doesn’t show up the status area 
- there is a 16 px margin left on the edges. ignored to remove that, place -16 as a left value, +16 as a right value, add these as constraints
- Whenever update a constraint, unless we update the frame using the triangular icon option, it will show the warning in orange color. 

Yay! my first app with the constraints is ready. 






References: 

No comments:

Post a Comment