UIButton *button =[[UIButton alloc]initWithFrame:CGRectMake(100, 100, 200, 40)]; button.backgroundColor = [UIColor redColor]; [button setTitle:@"我是Chenhaijian\n 我要换行" forState:UIControlStateNormal]; button.titleLabel.lineBreakMode = 0;//这句话很重要,不加这句话加上换行符也没用 [self.view addSubview:button];