Swift tabbar样式设置
2016-12-20 15:33
267 查看
UITableBarController是经常使用的
tabbar的背景颜色默认是半透明的好像
swift2.x
UITabBar.appearance().translucent =
false; //避免受默认的半透明色影响,关闭
UITabBar.appearance().barTintColor =
UIColor.whiteColor()//设置背景颜色
UITabBar.appearance().tintColor =
UIColor.yellowColor()//设置选中的背景颜色
UITabBar.appearance().clipsToBounds =
true;//去掉上面的分割线
注意:网上有下面这种设置背景颜色的方式。我试了,貌似没效果,不知道为什么。还是用上面的方式吧
UITabBar.appearance().backgroundColor =UIColor(red: 255/255,
green:0/255, blue:0/255, alpha:1)//设置为红色,不透明
tabbar的背景颜色默认是半透明的好像
swift2.x
UITabBar.appearance().translucent =
false; //避免受默认的半透明色影响,关闭
UITabBar.appearance().barTintColor =
UIColor.whiteColor()//设置背景颜色
UITabBar.appearance().tintColor =
UIColor.yellowColor()//设置选中的背景颜色
UITabBar.appearance().clipsToBounds =
true;//去掉上面的分割线
注意:网上有下面这种设置背景颜色的方式。我试了,貌似没效果,不知道为什么。还是用上面的方式吧
UITabBar.appearance().backgroundColor =UIColor(red: 255/255,
green:0/255, blue:0/255, alpha:1)//设置为红色,不透明
相关文章推荐
- Flex中如何通过horizontalGap样式,设置TabBar控件各个Tab间空格间距
- Flex中如何通过tabWidth样式,设置TabBar每个Tab宽度
- swift - tabBar图片设置的一些注意点
- Flex中如何通过horizontalGap样式,设置TabBar控件各个Tab间空格间距
- Swift设置tabbar
- ios-设置navigationBar和tabBar的样式
- swift开发笔记4 - 设置tabbar选中颜色
- Swift3.0设置微信朋友圈时间显示样式
- Swift/OC设置tabbar
- swift 设置状态栏样式不起作用
- Swift中设置自定义tabBar按钮的动画效果
- Flex中如何通过tabStyleName, tabWidth和textAlign样式,设置TabBar控件内文本对齐方式
- Swift - 给图片添加文字水印(图片上写文字,并可设置位置和样式)
- Swift中如何通过KVC将自定义的UITabbar设置为UITabbarController的tabbar
- Swift 设置 tabbar 字体颜色和字体大小
- 第二篇、Swift_自定义 tabbar 的 badgeValue显示样式
- iOS.swift 配置tabbar样式-点击tabbar更改字体颜色
- iOS TabbarController 设置底部Toolbar图片和文字颜色选中样式
- Flex中如何利用getChildAt()和setStyle(),设置TabBar单个Tab样式
- Swift - 给图片添加文字水印(图片上写文字,并可设置位置和样式)