0

在我的 iPhone 应用程序中。单击按钮时,我想更改标签中的文本大小

4

3 回答 3

0

以下是如何在运行时更改字体大小....

yourLabel.font=[UIFont systemFontOfSize:14];
于 2013-01-19T10:19:23.230 回答
0

创造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];

UILabel更改点击时的文本大小UIButton

-(IBAction)ButtonPressed:(id)sender
{
    [self.lbl setFont:[UIFont fontWithName:@"Arial-BoldMT" size:25]];
}
于 2013-01-19T10:20:15.140 回答
0
-(IBAction)changeFontOfLabel:(id)sender
{
   [self.lebelObject setFont:[UIFont fontWithName:@"American Typewriter" size:18];
}

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

于 2013-01-19T10:20:37.507 回答