Replace view inside UIStackView

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Replace view inside UIStackView



I have a UIStackView with 5 buttons inside. One of those buttons (#4) needs to be replaced by a UIPickerView once it is clicked (and switched back to the UIButton once one of the other four's is selected.



The UIStackView is horizontal, alignment is fill and distribution is Fill Proportionally.



The stack was done using storyboard, and I am trying to replace the view with:


override func viewDidLayoutSubviews(){
self.pickerView.frame.origin = self.view.viewWithTag(40)!.frame.origin
self.pickerView.frame.size = CGSize(width: 30, height: 30)

}



But my uistackview will not rearrange after the button click, and button #5 is staying on top of the pickerview.



Any ideas?









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Makefile test if variable is not empty

Will Oldham

Visual Studio Code: How to configure includePath for better IntelliSense results