简体   繁体   中英

uiview and uiscrollview

i am creating a dropdown button in my app. Like a pop-up control which is available in webapps. so when i click on a button, a new UIView containing a UIPickerView appears. i user beginanimations and commitanimations for dispalying and hiding the UIView . the new uiview is half the size of the scrollview.

I want that whenever the new uiview appears, the size of the scrollview should alter so that the i can scroll through the entire view. something like, when a keyboard appears, we reassign the size of scrollview, so that we can scroll entire view.

So how will i know, when the uiview appears. Is there a notification for beginanimations and commitanimations like for keyboard (UIKeyboardDidHideNotification)

thnx in advance.

if the subview you create and show have a viewController, -(void)viewWillAppear method of the viewController will be called on every appearance of that view.

In that method, you can somehow get the superview (for example calling nextResponder method) and resize the superview according to your needs.

Hope that helps.

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