首页 > 数据库技术 > 详细

手动创建 Label 和 button 的方法

时间:2016-01-20 18:40:02      阅读:148      评论:0      收藏:0      [点我收藏+]

  在.h文件当中先进行声明

@property (strong ,nonatomic)UILabel *label;

@property (strong ,nonatomic)UIButton *button;

在.m文件当中进行实现

self.label.text=@"HELLO WORLD";

self.label=[[UILabel alloc] initwithFrame: CGRectMake(0,0,0,0,0)];

[self.label settitlecolor :[UIColor redColor] forState :UIControlStateNormal];

self.label setTitle;@“button”forState:UIConttrolStateNormal];

[self.Button addTarget:self action :@selector(clicked)forcontrolEvents:UIControlEventTouchUpInside];//这个是button里面的在label里面没有

[self.view addSubview:self];

//创建botton和label一样就不写了、

   -(void)Clicked{

  

 

}

手动创建 Label 和 button 的方法

原文:http://www.cnblogs.com/xzz5211314/p/5145997.html

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