zoukankan      html  css  js  c++  java
  • ios6,ios7,ios7.1下设置UISearchbar的背景色

    ios系统升级到7.1后,原来在7.0下显示正常的UISearchbar现在又出现问题了。究其原因,是由于UISearchbar的subview又做修改了。

    float version = [[[UIDevicecurrentDevice] systemVersion] floatValue];

        if ([mySearchBar respondsToSelector:@selector(barTintColor)]) {

            float iosversion7_1 = 7.1;

            if (version >= iosversion7_1)

            {

                //iOS7.1

                [[[[mySearchBar.subviewsobjectAtIndex:0] subviews] objectAtIndex:0] removeFromSuperview];

                [mySearchBarsetBackgroundColor:[UIColor clearColor]];

            }

            else

            {

                //iOS7.0

                [mySearchBarsetBarTintColor:[UIColorclearColor]];

                [mySearchBarsetBackgroundColor:[UIColor clearColor]];

            }

        }

        else

        {

            //iOS7.0以下

            [[mySearchBar.subviewsobjectAtIndex:0] removeFromSuperview];

            [mySearchBarsetBackgroundColor:[UIColor clearColor]];

        }

    花开花谢春不管,水暖水寒鱼自知.
  • 相关阅读:
    vue
    vim 使用
    ssh 免密码登录
    shell 监控
    shell top
    使用网络技术---WebView
    安卓数据存储
    模块
    面向对象
    文件
  • 原文地址:https://www.cnblogs.com/taintain1984/p/3666046.html
Copyright © 2011-2022 走看看