您的位置:首页 > 移动开发 > IOS开发

按照教程初学IOS第一天demo1,实现点击切换字和颜色(有源码打包)

2016-07-17 11:26 501 查看

主要代码

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UILabel *label;

@end

@implementation ViewController

- (IBAction)redClick:(id)sender {
//1.修改文字
self.label.text=@"This is redClick";
//2.修改颜色
self.label.textColor=[UIColor redColor];
//3.修改字体大小
self.label.font=[UIFont systemFontOfSize:30];

}

- (IBAction)blueClick:(id)sender {
self.label.text=@"This is blueClick";
self.label.textColor=[UIColor blueColor];
self.label.font=[UIFont systemFontOfSize:30];
}
- (IBAction)greenClick:(UIButton *)sender {
self.label.text=@"This is greenClick";
self.label.textColor=[UIColor greenColor];
self.label.font=[UIFont systemFontOfSize:30];
}
http://download.csdn.net/detail/z2340868/9583257
                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: