UISearchBar和UISearchDisplayController
来源:互联网 发布:美工是做什么的 编辑:程序博客网 时间:2024/05/29 03:15
记录下在使用UISearchBar和UISearchDisplayController中遇到的问题
1.在iPad上,当UISearchDisplayController active的时候,UISearchBar会向下移动。
参考此处:UISearchDisplay issue - move down
解决方法:
if([self respondsToSelector:@selector(setEdgesForExtendedLayout:)]){ self.edgesForExtendedLayout = UIRectEdgeNone;}
2.在搜索的时候,影藏Cancel按钮
参考此处:Hide UISearchBar Cancel Button
解决方法:创建UISearchBar的一个子类,重写如下的方法
-(void)layoutSubviews{ [super layoutSubviews]; [self setShowsCancelButton:NO animated:NO];}
3.设置UISearchBar的背景为透明or无颜色
参考此处:UISearchBar clear background color or set background image [iphone sdk]
解决方法:
[searchBar setBackgroundImage:[UIImage new]];[searchBar setTranslucent:YES];
4.设置UISearchBar的背景颜色
参考此处:
- How to change background color of UISearchBar in iOS7
- [IOS] UISearchBar背景透明,去掉背景,自定义背景
解决方法:
searchBar.barTintColor = [UIColor redColor];
UISearchBar和UISearchDisplayController相关:
- 官方的例子Simple UISearchBar with State Restoration
- A simple tutorial of UISearchDisplayController (iOS 3-7)
- iPhone Tutorial – UISearchDisplayController with NSPredicate
0 0
- UISearchBar和UISearchDisplayController
- UISearchBar和UISearchDisplayController
- UISearchBar和UISearchDisplayController
- UISearchBar和UISearchDisplayController
- UISearchBar和UISearchDisplayController
- UISearchBar和UISearchDisplayController
- UISearchBar和UISearchDisplayController
- UISearchBar和UISearchDisplayController
- UISearchBar和UISearchDisplayController
- UISearchBar和UISearchDisplayController
- UISearchDisplayController 和 UISearchBar
- UISearchBar和UISearchDisplayController
- UISearchBar和UISearchDisplayController
- UISearchBar 和 UISearchDisplayController
- UISearchBar和UISearchDisplayController
- UISearchDisplayController和UISearchBar
- 自定义UISearchBar和UISearchDisplayController
- iOS UISearchBar和UISearchDisplayController
- ArrayList的toArray
- JPA 2.0 Vs Hibernate:缓存方法的差异(一)
- 所有旧版本JDK在官网中的下载地址
- 大型网站的灵魂——性能
- 同步 异步 并行 串行
- UISearchBar和UISearchDisplayController
- Cocos2d-x3.2 33种场景切换
- 【张孝祥并发课程笔记】01:传统线程技术和定时器技术回顾
- 黑马程序员——反射
- sql 标量子查询
- 【张孝祥并发课程笔记】02:传统线程互斥技术
- Servlet上传文件详细解析以及注意事项
- Cocos2d-x3.2 33种场景切换
- 【张孝祥并发课程笔记】03:传统线程同步通信技术