简体   繁体   中英

How to preserve a UIButton size after adding to a UIStackView

I am still learning iOS development with AutoLayout and UIStackView, so bear with me.

Basically I add a UIStackView and UIButton separately on my storyboard's view and then I set a random height to my UIButton and afterwards I add my UIButton to the UIStackView.

My question: Why doesn't my UIButton preserve its height after adding to the UIStackView?

Any help here, It will be appreciated so much thanks!

确保将高度约束添加到uibutton中,否则将其添加到Stackview时高度将被覆盖

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