开发者

How to make UIButton always on top, and change able to change the subviews?

开发者 https://www.devze.com 2023-04-09 20:16 出处:网络
I am using two v开发者_Go百科iews that are UIScrollView and UITextView. When program runs, UIScrollView displays. User can scroll it horizontally and paging enabled. If he taps on it the UITextView (w

I am using two v开发者_Go百科iews that are UIScrollView and UITextView. When program runs, UIScrollView displays. User can scroll it horizontally and paging enabled. If he taps on it the UITextView (which was at back side) comes forward in flip animation. To go back he needs to press back button (at navigation bar) then UIscrollView Comes forward. I am doing this just by detecting the superview and put the back view at front. All things are working good. Now, I have been asked to put next previous button at UIScrollView by pressing using can move left or right. The buttons will be clear colored background and an image at forground. So that looks like arrow.

I was thinking for it an got the idea to put UIButton at always on top and make flip in it.

I dont know that it will work or not.

Please tell me any idea if you think different or any sample/tutorial code to achieve this.

Thanks in advance


I'm not sure I understand what you want to do, but you can adjust Z position of views using those functions :

- (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview;
- (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview;

- (void)bringSubviewToFront:(UIView *)view;
- (void)sendSubviewToBack:(UIView *)view;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号