Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the iOS equivalent to Android layout weights?

Tags:

android

ios

Coming from Android development I'm trying to imitate some of the layouts that I've made in past applications, but now on the iPhone and iPad. Something that I use quite often in Android is layout weight. I've done a ton of searching, reading books, blogs, and I thought something like this would be possible in iOS 6, but I haven't been able to find anything. I've also tried watching a ton of tutorials on auto layout in iOS, but I really haven't found anything that accomplishes my task. This is driving me nuts. So... is there an iOS equivalent to Android layout weights?

like image 774
EGHDK Avatar asked Aug 19 '13 04:08

EGHDK


People also ask

What is layout weight in android?

Layout WeightA larger weight value allows it to expand to fill any remaining space in the parent view. Child views can specify a weight value, and then any remaining space in the view group is assigned to children in the proportion of their declared weight. Default weight is zero.

What is weight sum in android Studio?

Per documentation, android:weightSum defines the maximum weight sum, and is calculated as the sum of the layout_weight of all the children if not specified explicitly.

How to design linear layout in android?

Modify the default content of res/layout/activity_main. xml file to include few buttons in linear layout. Run the application to launch Android emulator and verify the result of the changes done in the application.

What is orientation property in LinearLayout?

The orientation attribute is used to arrange its children either in horizontal or vertical order. The valid values for this attribute are horizontal and vertical. If the value of the android:orientation attribute is set to vertical, the children in the linear layout are arranged in a column layout, one below the other.


1 Answers

Use StackView (similar to LinearLayout in Android)

Select Distribution = Fill Equality (similar to weight)

Example:enter image description here

like image 154
CristianCotrena Avatar answered Oct 02 '22 13:10

CristianCotrena