What is the equivalent of iOS StackView in Android

Viewed 6766

I have a group of EditTexts inside a ConstraintLayout as shown in the picture below:

enter image description here

I would like to put them inside something that's equivalent to a StackView in iOS/Xcode Storyboard. Then after that, I would like to set the Distribution attribute to something like Fill Equally.

How can I do this, NOT in code, but in Android Studio Layout Editor?

Update: Based on a comment that suggests I should explain what an iOS StackView is, here it is: Instead of setting constraints for each EditText individually (which would be too tedious), I would like to do what Xcode already offers. That is grouping all of these EditTexts in a so-called 'Stack'. By doing so, I would only have to set the constraint of the 'Stack' once. Inside the Stack, then I need to describe how each EditText is layed out in relation to one another. Fill Equally distribution is one way.

1 Answers

I think you are searching about the LinearLayout which is equivalent to StackView in iOS,

LinearLayout can have two directions, horizontal and vertical, and you can select the needed one as your case.

Read about the LinearLayout here in the android documentation, I think this will help.

Related