开发者

Issue with UIView size and pushViewController

开发者 https://www.devze.com 2023-04-12 11:44 出处:网络
I have UINavigationController with UIView which have table, text field and button. When user focus on text field I resize UIView for keyboard using following code:

I have UINavigationController with UIView which have table, text field and button. When user focus on text field I resize UIView for keyboard using following code:

CGRect viewFrame = self.view.frame;
viewFrame.size.height = 460.f - (up ? 260.f : 44.f);

self.view.frame = viewFrame;

After user click on the button I switch to the next view using following code:

UserViewController *userViewController = [UserViewController userWithId:((UIButton *)sender).tag];
[self.navigationController pushViewController:userViewController animated:YES];

The problem is that when I'm switching to next view the current view which is resized returns back to ori开发者_如何学编程ginal size and I don't like how that looks. I want to keep size of UIVIew and keyboard during animation and return it back to default state only after user click back button.


Maintain You UIView Resize Coading in

-(void) ViewWillAppear :(BOOL) animation { ..coading }

-(void) ViewWillDisAppear :(BOOL) animation {

}

0

精彩评论

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

关注公众号