ios6,ios7,ios7.1下设置UISearchbar的背景色
2024-10-21 07:45:59
ios系统升级到7.1后,原来在7.0下显示正常的UISearchbar现在又出现问题了。究其原因,是由于UISearchbar的subview又做修改了。
float version = [[[ UIDevice currentDevice ] systemVersion ] floatValue ];
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 ]];
}
最新文章
- C#实现微信开发前奏
- 1o_Samba
- Python 2.7_发送简书关注的专题作者最新一篇文章及连接到邮件_20161218
- flex中DataGrid里使用itemRenderer后数据无法绑定到数据源的问题
- 使用Unity3d的Physics.Raycast()的用法做子弹射击
- MEF学习小结 z
- time.h
- 一个跨域请求的XSS漏洞
- GOPS2017全球运维大会 • 深圳站 历届金牌讲师精选亮相
- HDU 2485 Destroying the bus stations
- Linux的软件安装(JDK安装,Mysql安装,Tomcat安装)
- Django教程01-全流程
- TCP/IP 笔记 - TCP拥塞控制
- wamp环境搭建(apache安装,mysql安装,php安装)
- 【iCore1S 双核心板_ARM】例程十一:RTC实时时钟实验——显示时间和日期
- tensorflow 的tf.split函数的用法
- python 之模块之 xml.dom.minidom解析xml
- HDU 4705 Y (2013多校10,1010题,简单树形DP)
- 编码转换(UTF8->;GBK)
- ICE新手入门版
热门文章
- window下手动搭建 PHP+Nginx+Mysql(转)
- keepalive support-----Programming applications
- 基于HBase0.98.13搭建HBase HA分布式集群
- C语言实现双向链表删除节点、插入节点、双向输出等操作
- How to manage and balance “Huge Data Load” for Big Kafka Clusters---reference
- apache服务器php程序
- android之Java+html+javascript混合开发
- 在iis中mantisbt配置过程
- Pagekit安装
- .NET生成PDF文件