UILable &UIImageView& UIButton布局
来源:互联网 发布:网络贷款利息计算器 编辑:程序博客网 时间:2024/06/01 09:03
#import "ViewController.h"
@interface ViewController ()
{
UILabel*lable;
}
@end
@implementation ViewController
- (void)viewDidLoad {
[superviewDidLoad];
lable=[[UILabelalloc ]initWithFrame:CGRectMake(80, 300, 200, 200)];
lable.text=@"我是一个坚强的人";
lable.textColor=[UIColorblackColor];
lable.backgroundColor=[UIColor redColor];
lable.textAlignment=NSTextAlignmentCenter;
lable.numberOfLines=0;
lable.font=[UIFontsystemFontOfSize:30];
[self.viewaddSubview:lable];
UIImageView*imageView=[[UIImageViewalloc]init];
imageView.frame=CGRectMake(80, 20, 200, 200);
imageView.layer.masksToBounds=YES;
imageView.layer.cornerRadius=100;
[imageView setImage:[UIImageimageNamed:@"Cachestemp (1).jpg"]];
[self.viewaddSubview:imageView];
UIButton*button=[UIButtonbuttonWithType:UIButtonTypeRoundedRect];
button.frame=CGRectMake(130, 600, 100, 50);
button.backgroundColor=[UIColorgreenColor];
[button setTitle:@"点击"forState:UIControlStateNormal];
[button setTitleColor:[UIColorblackColor]forState:UIControlStateNormal];
//[button setFont:[UIFont systemFontOfSize:20]];
button.layer.masksToBounds=YES;
button.layer.cornerRadius=10;
[self.viewaddSubview:button];
[button addTarget:selfaction:@selector(gaibian)forControlEvents:UIControlEventTouchUpInside];
// Do any additional setup after loading the view, typically from a nib.
}
-(void)gaibian{
lable.text=@"其实我是一个暖男,时间久了你就会爱上我的,不信你试试?";
NSLog(@"fubaibijindemeinvdengwolaicao");
}
- (void)didReceiveMemoryWarning {
[superdidReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
- UILable &UIImageView& UIButton布局
- 《基础控件—UIButton、UILable、UIImageView》
- UILable UIImageView
- OC UILable UITextFiled UIButton
- UILable,UIButton字体加粗
- UIWindow UIView UILable UIButton
- UILable UIImageView 设置圆角
- iOS的UIButton和UILable
- UILable,UIFont,UIButton常见属性
- UIButton UIImageView UIScrollView UIWebView
- UIButton,UIImageView,UILabel,UITextField
- UIImageView与UIButton
- UIImageView 和UIButton
- UIImageView和UIButton区别
- UIImageView和UIButton区别
- UIButton和UIImageView 区别
- UILabel,UITextField,UIButton,UIimageView
- UIImageView和UIButton的区别
- SVN还原文件到历史版本详解
- RecyclerView源码分析
- 阈值化
- 剑指Offer:面试题12——打印1到最大的n位数(java实现)
- 定价类型更新
- UILable &UIImageView& UIButton布局
- C++中的宏定义
- 对快速排序的一些理解
- Jetty启动webApp报错,是因为没有加全依赖
- QT5,5 webview 刷新不出网页解决的办法
- 向JSON文件中写数据和读数据
- elasticsearch centos7安装
- JSP指令
- ejabberd中的http反向推送