简体   繁体   中英

What is the equivalent of iOS StackView in Android

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

在此处输入图片说明

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM