简体   繁体   中英

how to add button subview after removefromsubview uibutton?

在此处输入图片说明

I want to hide and show button from multiple button. Auto layout other button automatically

 fiveBtn.tag = 1000;
 [[self.view viewWithTag:1000] removeFromSuperview];
 fiveBtn=nil;

after i want to add again in storyboard below image please check ... while clicking four the button five button hide and while clicking third button five button show .. my problem auto layout

What you can do is to group your views under a stack view. Then when you hide a particular view, the remaining views will be shifted automatically to fill the space.

You may want to check out the Apple Documentation on Stack Views: https://developer.apple.com/reference/uikit/uistackview

or online tutorials such as: https://www.appcoda.com/stack-views-intro/

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