WEB开发网
开发学院手机开发iPhone 开发 iOS中点击按钮修改文本的尺寸 阅读

iOS中点击按钮修改文本的尺寸

 2013-01-21 16:13:58 来源:WEB开发网   
核心提示: 创建UILabelself.lbl=[[UILabel alloc] initWithFrame:CGRectMake(135, 290,200,35)]; self.lbl.backgroundColor=[UIColor clearColor]; NSString *str=[NSString stringW

 创建UILabel

self.lbl=[[UILabel alloc] initWithFrame:CGRectMake(135, 290,200,35)];
self.lbl.backgroundColor=[UIColor clearColor];
NSString *str=[NSString stringWithFormat:@"%.f",[self.slider value]];
[self.lbl setFont:[UIFont fontWithName:@"Arial-BoldMT" size:16]];
self.lbl.text=str;
[self.View addSubview:self.lbl];

点击UIButton时修改UILabel文本尺寸

-(IBAction)ButtonPressed:(id)sender
{
[self.lbl setFont:[UIFont fontWithName:@"Arial-BoldMT" size:25]];
}

Tags:iOS 点击 按钮

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接