第三篇简书

1.//隐藏返回按钮的Back文字

[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60) forBarMetrics:UIBarMetricsDefault];

2.UISegmentedControl选中时

//定义选中状态的样式selected,类型为字典

NSDictionary *selected =@{NSFontAttributeName:[UIFont systemFontOfSize:20],

NSForegroundColorAttributeName:[UIColor whiteColor]};

//定义未选中状态下的样式normal,类型为字典

NSDictionary *normal =@{NSFontAttributeName:[UIFont systemFontOfSize:20],

NSForegroundColorAttributeName:[UIColor grayColor]};

/*

NSFontAttributeName ->系统宏定义的特殊键,用来给格式字典中的字体赋值

NSForegroundColorAttributeName ->系统宏定义的特殊键,用来给格式字典中的字体颜色赋值

*/

//通过setTitleTextAttributes: forState:方法来给test控件设置文字内容的格式

[segMent setTitleTextAttributes:normal forState:UIControlStateNormal];

[segMent setTitleTextAttributes:selected forState:UIControlStateSelected];

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容