首页 > 移动平台 > 详细

IOS中的textattribute对应的key值

时间:2014-04-17 08:42:22      阅读:625      评论:0      收藏:0      [点我收藏+]

设置title样式 

 

UINavgationBar提供了titleTextAttributes 属性来简单的设置其title样式,titleTextAttributes是一个NSDictionary类型,包含的固定的属性名称,可以用来设置title的样式,指定的属性keys声明于NSString UIKit Additions Reference扩展中,包括: 

bubuko.com,布布扣
NSString *const UITextAttributeFont,设置title的文字字体;


NSString *const UITextAttributeTextColor,设置title的文字颜色;


NSString *const UITextAttributeTextShadowColor,设置titlewz的阴影颜色;


NSString *const UITextAttributeTextShadowOffset,设置titlewz阴影的平移量 ;
bubuko.com,布布扣

 

 

如,设置title样式为:系统默认bold类型20号红色字体,阴影颜色为白色,右下偏移2像素 

 

NSDictionary *navTitleArr = [NSDictionary dictionaryWithObjectsAndKeys:
[UIFont boldSystemFontOfSize:20],UITextAttributeFont,
[UIColor redColor],UITextAttributeTextColor ,[NSValue valueWithCGSize:CGSizeMake(2.0, 2.0)] , UITextAttributeTextShadowOffset ,
[UIColor whiteColor] ,UITextAttributeTextShadowColor ,nil];
[navBar setTitleTextAttributes:navTitleArr];

 

   

IOS中的textattribute对应的key值,布布扣,bubuko.com

IOS中的textattribute对应的key值

原文:http://www.cnblogs.com/hushuai-ios/p/3669097.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!