ios中點擊按鈕修改文本的尺寸

字號:


    創(chuàng)建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]];
    }