How to bring subview over scroll view on iOS?

In iOS development, I want to add a subview in a view based application. I have a scroll view above that has views containing labels and I used Interface Builder to design those views.

How do I move a subview on top of a scroll view?

0


a source to share


2 answers


The way I do it in IB sets the view mode in the document window for the Outline View (second button). Then I drag a view from the library over the scroll view and it will be inserted as a scroll view.



If you get a disclosure triangle next to your scrollview, it will have a new view inserted as a subview.

0


a source


If you mean in xib, first drag the scroll view and then drag other subzones into the scroll.

If you mean programmatically, this should work:



[scrollView addSubview: mySubview];

      

0


a source







All Articles