iOS UISearchBar 属性 设置详解
来源:互联网 发布:cnc编程代码 编辑:程序博客网 时间:2024/06/07 01:03
[self.view setBackgroundColor:[UIColor colorWithRed:239.0/255 green:239.0/255 blue:239.0/255 alpha:1.0f]]; MySearchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 65, width, 45)]; MySearchBar.delegate = self; MySearchBar.barStyle=UIBarStyleDefault; MySearchBar.placeholder=@"Search"; [MySearchBar setShowsCancelButton:NO];//显示右侧取消按钮 MySearchBar.keyboardType=UIKeyboardTypeNamePhonePad; float version = [[[ UIDevice currentDevice ] systemVersion ] floatValue ]; // theTableView.tableHeaderView = searchBar; if ([ MySearchBar respondsToSelector : @selector (barTintColor)]) { float iosversion7_1 = 7.1 ; if (version >= iosversion7_1) { //iOS7.1 [[[[ MySearchBar . subviews objectAtIndex : 0 ] subviews ] objectAtIndex : 0 ] removeFromSuperview ]; [ MySearchBar setBackgroundColor :[ UIColor clearColor ]]; } else { //iOS7.0 [ MySearchBar setBarTintColor :[ UIColor clearColor ]]; [ MySearchBar setBackgroundColor :[ UIColor clearColor ]]; } } else { //iOS7.0 以下 [[ MySearchBar.subviews objectAtIndex : 0 ] removeFromSuperview ]; [ MySearchBar setBackgroundColor :[ UIColor clearColor ]]; } [self.view addSubview:MySearchBar];
searchBar.searchBarStyle =UISearchBarStyleMinimal;
0 0
- iOS UISearchBar 属性 设置详解
- ios-设置UISearchBar输入框的颜色等属性
- UISearchBar详解(一)基本属性
- ios开发- UISearchBar详解+实例
- iOS uisearchbar
- ios UISearchBar
- IOS UISearchBar
- iOS UISearchBar
- IOS UISearchBar
- iOS UISearchBar
- UISearchBar详解
- UISearchBar 详解
- UISearchBar详解
- IOS开发代码分享之设置UISearchBar的背景颜色
- iOS 6/7 UISearchBar的背景色设置
- iOS 通过设置颜色去除UISearchBar的灰色背景
- iOS UISearchBar 设置光标颜色和取消按钮颜色
- iOS-详解文本属性attributes,设置段落格式,空心字体
- python的__name__属性
- Ugly Number II | Leetcode 丑数II
- c++集锦
- 33. Search in Rotated Sorted Array
- C++第四次作业
- iOS UISearchBar 属性 设置详解
- JavaScript 面向对象编程
- 围圈小朋友报数退出问题
- xUtils里使用HttpUtils时出现的无法访问HttpRequestBase的错误
- python 调用top命令获取输出信息
- jQuery中的选择器
- iOS中UISearchBar(搜索框)使用总结
- linux下yum安装mysql步骤
- Mysql cluster初学