G.Jayamurugan
G.Jayamurugan

Reputation: 1

how to add button subview after removefromsubview uibutton?

enter image description here

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

Upvotes: 0

Views: 240

Answers (1)

sohan vanani
sohan vanani

Reputation: 1574

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/

Upvotes: 2

Related Questions