加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Swift tabbar样式设置

发布时间:2020-12-14 06:31:58 所属栏目:百科 来源:网络整理
导读:UITableBarController是经常使用的 tabbar的背景颜色默认是半透明的好像 swift2.x UITabBar . appearance (). translucent = false ; // 避免受默认的半透明色影响,关闭 UITabBar . appearance (). barTintColor = UIColor . whiteColor () // 设置背景颜色

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)//设置为红色,不透明

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读