\n","author":{"@type":"Person","name":"Kuldeep Tanwar"},"upvoteCount":1,"answerCount":2,"acceptedAnswer":null}}
Reputation: 3526
I want to ask a simple question how can I temporary bring a subview to front to view its element without changing its position by dragging and dropping. The problem i face all the time is i forgot to put the views back to there position and that causes lot of trouble specially if you are working on the view that have large number of subviews.
For a view controller like this :-
Upvotes: 1
Views: 2214
Reputation: 163
FYI, for those who are wondering, the view closest to the bottom of the list (on the left) will show in the front. So in the case below, view 'a' will be in front of 'b' and 'b' will be in front of 'c'
Upvotes: 7
Reputation: 6396
If you need your views to be readily accessible for viewing/editing without having to rearrange them, I would actually recommend breaking them out into their own view and then stitching them together in the correct order in your code. This will ensure that all elements will be put in the proper order and will always be easily editable. Something like this:
And then in your code, in somewhere like viewDidLoad
:
[self.view addSubview:view2];
[self.view addSubview:view3];
Upvotes: 2