i insert 2 UIImageView with tag 1 and 100 to UIView,
how to access to UIView and check how many subview on it or select tag 1 to be the top of view ?
If you need a quick way to get hold of a view inside a complicated view hierarchy, you're looking for viewWithTag() – give it the tag to find and a view to search from, and this method will search all subviews, and all sub-subviews, and so on, until it finds a view with the matching tag number.
An integer that you can use to identify view objects in your application.
The UIView class is a concrete class that you can instantiate and use to display a fixed background color. You can also subclass it to draw more sophisticated content.
"subviews" means the views which are holding by the curent view. For example, you have a view (will call it as MyView) which include a button. Button is a view too (UIButton is a kind of view). So, MyView is superview for the button.
"check how many subview on it"
[myView.subviews count];
"or select tag 1 to be the top of view"
[myView bringSubviewToFront:[myView viewWithTag:1]];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With