既然很简单,应该先自己搜索控件去了解其函数,了解以后如还有不懂再提问。代码很简单,见下面先将label和slider定义为成员变量@interface ViewController : UIViewController{ UILabel *label; UISlider *slider;}在viewDidLoad中 label = [[UILabelalloc]initWithFrame:CGRectMake(100, 100, 200, 100)]; label.text = @"AAA"; label.font = [UIFontfontWithName:@"Georgia-Bold"size:18.0]; [self.viewaddSubview:label]; slider = [[UISlideralloc]initWithFrame:CGRectMake(100, 200, 200, 100)]; [slideraddTarget:selfaction:@selector(changeLabel:) forControlEvents:UIControlEventValueChanged]; //在slider数值变化时会调用changeLabel方法 [self.viewaddSubview:slider];然后再写changeLabel方法-(IBAction)changeLabel:(UISlider *)sender{ float fontsize = [sender value]*100;(因为滑动条的value是0-1之间,我们乘以一个100~看的清楚) NSLog(@"%f",fontsize); label.font = [UIFontfontWithName:@"Georgia-Bold"size:fontsize];}有不懂的地方随时来问