objective c - A classic design and a trivial issue with UIScrollView -
i feel idiot, because fight something, should straighforward, there hidden sabouteur in xcode somewhere.
the ui built in storyboard.
i have modal view, contains upper uinavigationbar , uiscrollview...inside scrollview textfields. understand when start edit text in textfield, keyboard pops out. thats ok. tracking moment via notificationcenter.
[notificationcenter addobserver:self selector:@selector(keyboarddidshow:) name:uikeyboarddidshownotification object:nil];
i calling selector when happens
-(void)keyboarddidshow:(nsnotification *)notification { ... code changing frame }
of course, need resize scrollview make room keyboard, attach newly created cgrect "frame" value of scrollview's frame, scrollview not resize according wishes, instead takes size of vieconntroller's view minus statusbar's 44 pixels..
i lost few hours on , drives me nuts. can help?
first: why need change frame of scrollview? keyboard appears above anyway. perhaps more convenient way catch editing btw uitextfielddelegate
protocol, guess way fine too.
second: if want modify view view controller's view
property, cannot change frame. full screen (minus status bar, minus nav bar if any) default. if want dynamically resize view has subview of self.view
.
Comments
Post a Comment