简体   繁体   中英

UIView Hides on textfield tap

这个

is the structure of my UIViewController, here is the problem scenario

  1. Pressing Add bar button
  2. UIView named "NewAddressView" (refer image) is opened with animation

    - (IBAction)AddAddressAction:(id)sender { [UIView animateWithDuration:0.5 delay:0.1 options: UIViewAnimationOptionCurveEaseOut animations:^{ self.NewAddressView.frame = CGRectMake(0, 0, 320, 460); } completion:^(BOOL finished){ }]; } - (IBAction)CloseAddAddress:(id)sender { [UIView animateWithDuration:0.5 delay:0.1 options: UIViewAnimationOptionCurveEaseOut animations:^{ self.NewAddressView.frame=CGRectMake(0,500,320,460); } completion:^(BOOL finished){ }]; }
  3. This "NewAddressView" view contains textfield as shown in image.

  4. On tapping the textfield the "NewAddressView" hides automatically, no extra code is written to hide "NewAddressView".

  5. Just noticed that the view does not hide it moves to its original position ie CGRectMake(0,500,320,460). There is nothing else done just normal view and textfield.

Kindly let me know if there is anything I have to add.

Thanks

尝试通过编写以下内容将视图带到前面:

[self.view bringSubviewToFront:self.NewAddressView];

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