UIView隐藏在文本字段上

时间:2015-11-23 11:31:01

标签: ios objective-c iphone uiview

this

是我的UIViewController的结构,这是问题场景

  1. 按添加栏按钮
  2. 用动画

    打开名为“NewAddressView”(参考图像)的UIView
    - (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. 此“NewAddressView”视图包含文本字段,如图所示。

  4. 在点击文本字段时,“NewAddressView”会自动隐藏,不会编写额外的代码来隐藏“NewAddressView”。

  5. 只是注意到视图没有隐藏它移动到其原始位置,即CGRectMake(0,500,320,460)。普通视图和文本字段没有其他功能。

  6. 请告诉我是否有任何必须添加的内容。

    谢谢

0 个答案:

没有答案