Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 单击按钮时无法更改标签中的文本大小_Iphone_Ios_Objective C_Ios5_Uibutton - Fatal编程技术网

Iphone 单击按钮时无法更改标签中的文本大小

Iphone 单击按钮时无法更改标签中的文本大小,iphone,ios,objective-c,ios5,uibutton,Iphone,Ios,Objective C,Ios5,Uibutton,在我的iphone应用程序中。我想在单击按钮时更改标签中的文本大小这里是如何在运行时更改字体大小 yourLabel.font=[UIFont systemFontOfSize:14]; 创建UILabel self.lbl=[[UILabel alloc] initWithFrame:CGRectMake(135, 290,200,35)]; self.lbl.backgroundColor=[UIColor clearColor]; NSString *str=[NSStr

在我的iphone应用程序中。我想在单击按钮时更改标签中的文本大小这里是如何在运行时更改字体大小

yourLabel.font=[UIFont systemFontOfSize:14];

创建
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];
点击
ui按钮时更改
ui标签的文本大小

-(IBAction)ButtonPressed:(id)sender
{
    [self.lbl setFont:[UIFont fontWithName:@"Arial-BoldMT" size:25]];
}
这可能对您有所帮助:)

并写出正确的字体名称。请在此处查看以下列表:

-(IBAction)changeFontOfLabel:(id)sender
{
   [self.lebelObject setFont:[UIFont fontWithName:@"American Typewriter" size:18];
}