简体   繁体   中英

iPhone4 how to add/animate a UIView to appear under a UIButton?

I have a "side panel" like widget in my app that can be swiped in from the side of the screen. In order to help the users find the panel, I also added a UIButton to do the same thing - scroll the panel on and off screen.

The view comes from a different view controller, otherwise I would've simply created an extra panel in the interface builder and positioned it properly.

My problem is that the side panel gets positioned over the button, so if it is displayed with a button, it can only be dismissed with a gesture.

is it possible to specify at which "depth" I add a UIView when I programmatically add it in code? This is the snipped that slides the panel in or out within the animation block.

  self.audioSystemController.view.frame =CGRectMake(0,20, 120,460);

I need the UIView to be shown below a UIButton , so the button may be used to dismiss the view. I know this is redundant, but I cannot depend on the users to simply discover the side swiping gestures :/

Thank you for your help!

insertSubview:belowSubview:出UIView的insertSubview:belowSubview:方法。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM