UISegmentedControl更改圆角

Wesley13
• 阅读 507
  UISegmentedControl *segmentC = [[UISegmentedControl alloc]initWithItems:[NSArray arrayWithObjects:@"本周周报",@"历史周报", nil]];
    
    segmentC.frame = CGRectMake(0,0, 120, 30);
    
   
    
    segmentC.layer.borderColor = [UIColor whiteColor].CGColor;
    
    segmentC.layer.borderWidth = 1;
    
    segmentC.tintColor = [UIColor whiteColor];
    
    segmentC.backgroundColor = [UIColor clearColor];
    
    
    
    NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName,[UIFont systemFontOfSize:14],NSFontAttributeName,nil];
    
    [segmentC setTitleTextAttributes:dic forState:UIControlStateNormal];
    
    segmentC.layer.cornerRadius = 15.0f;
    
    segmentC.layer.masksToBounds = YES;
    
    
    segmentC.tintColor = [UIColor whiteColor];
    
        self.navigationItem.titleView = segmentC;
点赞
收藏
评论区
推荐文章
blmius blmius
2年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Wesley13 Wesley13
2年前
PPDB:今晚老齐直播
【今晚老齐直播】今晚(本周三晚)20:0021:00小白开始“用”飞桨(https://www.oschina.net/action/visit/ad?id1185)由PPDE(飞桨(https://www.oschina.net/action/visit/ad?id1185)开发者专家计划)成员老齐,为深度学习小白指点迷津。
Wesley13 Wesley13
2年前
UINavigationController设置透明背景
self.navBar\\UINavigationBaralloc\initWithFrame:CGRectMake(0,0,self.view.frame.size.width,NAV\_BAR\_HEIGHT)\;\self.navBarsetBackgroundImage:\UIImageimageWithColor:
Stella981 Stella981
2年前
List的Select 和Select().tolist()
List<PersondelpnewList<Person{newPerson{Id1,Name"小明1",Age11,Sign0},newPerson{Id2,Name"小明2",Age12,
Stella981 Stella981
2年前
Python 实现网页截屏、查库、发邮件
本文介绍了使用Python(2.7版本)实现网页截屏、查库、发邮件的demo。用到了selenium、phantomjs、mailer、jinja2、mysqldb还有image,都是比较典型的用法,可复用性比较强。代码本demo是用于发周报邮件的,周报内容包括数据库中的记录以及网页指定元素的截屏。linux中可以用cro
Stella981 Stella981
2年前
Android蓝牙连接汽车OBD设备
//设备连接public class BluetoothConnect implements Runnable {    private static final UUID CONNECT_UUID  UUID.fromString("0000110100001000800000805F9B34FB");
Wesley13 Wesley13
2年前
thinkphp 基本配置
12returnarray(34//定义数据库连接信息5'DB\_TYPE''mysql',//指定数据库是mysql67'DB\_HOST''localhost',89'DB\_NAME''uchome',//数据库名1011'DB\_USER''root
Easter79 Easter79
2年前
SwiftUI从入门到实战第2章第5节:Segment
相关课程:http://hdjc8.com/hdjc/swiftUI/(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fhdjc8.com%2Fhdjc%2FswiftUI%2F)Segment分段控件,类似于UIKit中的UISegmentedControl。分段控件提供一栏选项按钮
Wesley13 Wesley13
2年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
3个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这