UISearchDisplayDelegate如何删除这个不透明的视图? [英] UISearchDisplayDelegate how to remove this opaque view?
本文介绍了UISearchDisplayDelegate如何删除这个不透明的视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从 UISearchDisplayController 以编程方式显示/隐藏此不透明视图?
可能在 searchDisplayControllerWillBeginSearch
或 searchDisplayControllerDidBeginSearch
我需要设置一些东西......但是什么?
谢谢。
使用
UIKeyboardWillAppearNotification
。 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow)name:UIKeyboardWillShowNotification object:nil];
OpaqueView是 UIControl ,alpha = 0.8。
- (void)keyboardWillShow {
for(UIView * subview in self.view.subviews){
if([subview] isKindOfClass:[UIControl class]]){
UIControl * v =(UIControl *)subview;
if(v.alpha< 1){
v.hidden = YES;
}
}
}
}
I使用这种 ORRIBLE方式临时修复问题....任何其他想法将不胜感激!
谢谢。
how can i programmatically show/hide this opaque view from UISearchDisplayController?
Probably in searchDisplayControllerWillBeginSearch
or searchDisplayControllerDidBeginSearch
i need to set something... but what?
thanks.
解决方案
Temporary solved using UIKeyboardWillAppearNotification
.
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow) name:UIKeyboardWillShowNotification object:nil];
OpaqueView is an UIControl with alpha = 0.8.
- (void) keyboardWillShow {
for( UIView *subview in self.view.subviews ) {
if( [subview isKindOfClass:[UIControl class]] ) {
UIControl *v = (UIControl*)subview;
if (v.alpha < 1) {
v.hidden = YES;
}
}
}
}
I used this ORRIBLE way to temporary fix problem.... any other idea will be appreciated!
thanks.
这篇关于UISearchDisplayDelegate如何删除这个不透明的视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文