简体   繁体   中英

IOS Swift nested vertical StackView

Is it a good practice to have nested vertical or horizontal StackViews in my project there is requirement to do so or is there any other way to avoid this or it is okay to use nested vertical StackViews.

Storyboard looks like below it is working fine and UI is appearing as expected across resolution but not sure if it is good practice or not

在此处输入图片说明

As always there are Pros and Cons.

Pro:

  • Layout structure is easily comprehensive
  • You can hide/show groups of views very easily
  • Saves time towards doing all things with constraints
  • Reordering is a lot easier

Con:

So you have to decide or test in your own situation, if you notice any performance issues. Maybe use an older device like iPhone 6 or so and try to open your view controller that contains this layout and check if it lags or so.

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