码迷,mamicode.com
首页 > 其他好文 > 详细

定义某个按钮上的文字

时间:2014-07-21 09:29:23      阅读:265      评论:0      收藏:0      [点我收藏+]

标签:style   color   for   re   c   size   

//给某个按钮上的数字设置大小

+ (void)setDefaultFont:(id)sender size:(float)size{

    [sender setFont:[UIFont fontWithName:@"Helvetica" size:size]];

}

 

 

用法:

-(void)initButton

{

    UIButton *rightButton = [[UIButton alloc] initWithFrame:CGRectMake(50, 100, 100, 50)];

    [rightButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];

    rightButton.backgroundColor=[UIColor redColor];

    //给按钮上的字设置大小

    [Utils setDefaultFont:rightButton size:20];

    [rightButton setTitle:@"完成" forState:UIControlStateNormal];

    [self.view addSubview:rightButton];

 

}

 

定义某个按钮上的文字,布布扣,bubuko.com

定义某个按钮上的文字

标签:style   color   for   re   c   size   

原文地址:http://www.cnblogs.com/yang-guang-girl/p/3856317.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!