标签:blog 按钮 开发 frame ios开发 ima custom creat uiimage
1 //创建一个可以显示图片的按钮。 2 -(void)creatImageBtn{ 3 UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; 4 btn.frame = CGRectMake(100, 100, 100, 100); 5 UIImage *icon1 = [UIImage imageNamed:@"icon1.png"]; 6 UIImage *icon2 = [UIImage imageNamed:@"icon2.png"]; 7 [btn setImage:icon1 forState:UIControlStateNormal]; 8 [btn setImage:icon2 forState:UIControlStateHighlighted]; 9 [self.view addSubview:btn]; 10 } 11
iOS开发---UIButton 1 //创建一个可以显示图片的按钮。
标签:blog 按钮 开发 frame ios开发 ima custom creat uiimage
原文地址:http://www.cnblogs.com/vector11248/p/7567486.html