简体   繁体   中英

Change value of UILabel inside UIStackView in .xib file

I am creating a vertical UIStackView inside a UIView and placing UILabel elements inside it.

在此处输入图片说明

Now, I want to change the height of Label inside the UIStackView . But the height property seems to be disabled.

在此处输入图片说明

Alternatively, I am able to set height constraint for the label and change it's value programatically. I want to know if there is a way to change the value in the XIB itself as my purpose is to set a static value and cut down on adding code for it.

First add UIView in UIStackView and Then Add UILabel under view. Set label's constraint. Now you can just change the UIView Frame from Size inspector, it will automatically change the label frame. 在此处输入图片说明

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