在视图上导航时发出UISearchBar

时间:2018-07-12 00:58:37

标签: ios objective-c uinavigationcontroller

我的代码如下:

UISearchBar *searchBar;

- (IBAction)next:(UIButton *)sender {

    searchBar.userInteractionEnabled=false;
    searchBar.alpha =0;
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Cot" bundle: nil];
    CotViewController *someViewController = [storyboard instantiateViewControllerWithIdentifier:@"Cot"];
    [self.navigationController pushViewController:someViewController animated:YES];

}

代码工作正常,但是当我进行一次推送并返回到第一个UIViewController

属性searchBar.userInteractionEnabled=false;完美运行

,但其他财产 searchBar.alpha =0;不起作用,因为它看起来像alpha = 1

出什么问题了?谢谢。

0 个答案:

没有答案