我正在构建一个应用程序,我想实现搜索视图控制器。我用它的搜索栏构建表视图控制器。我的搜索控制器工作正常。但我希望当用户单击搜索按钮时:控制器从当前视图控制器显示透明度。完全像在iphone应用程序上的facebook搜索。
我试过这段代码:
SearchAllViewController *search= [[SearchAllViewController alloc] init];
search.view.backgroundColor= [[UIColor blackColor] colorWithAlphaComponent:0.6];
search.from=tabSelected;
[self.view addSubview:search.view];
我的搜索控制器显示的是透明度但值为"来自"没有设置,所以我没有结果!但是在使用此代码时,它已设置但透明度不是:
UIStoryboard* sb = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
SearchAllViewController *search = [sb instantiateViewControllerWithIdentifier:@"search"];
search.view.backgroundColor= [[UIColor blackColor] colorWithAlphaComponent:0.6];
search.from=tabSelected;
[self.view addSubview:search.view];
任何帮助请????