1.先上个效果图
2.再贴上实现代码
- (IBAction)btnClick:(id)sender
{
//设置标题的时候最为关键,插入N个换行符留出足够控件
UIAlertView *alert = [[UIAlertViewalloc]initWithTitle:@"这是标题\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
message:nil
delegate:self
cancelButtonTitle:nil
otherButtonTitles:@"确定",nil];
//内容
UILabel *lblAnnounce = [[UILabelalloc]initWithFrame:CGRectMake(20,32,250, 300)];
lblAnnounce.backgroundColor = [UIColorclearColor];
lblAnnounce.textColor = [UIColorwhiteColor];
lblAnnounce.font = [UIFontsystemFontOfSize:15.0f];
lblAnnounce.numberOfLines = 0;//上面两行设置多行显示
lblAnnounce.text =@"文字内容,随便你添加什么\n1.这是第一行;\n2.这是第二行;\n3.这是第三行;\n4.你想加多少行都行!";
//已阅读和不再提示
CGRect cbReadFrame = CGRectMake(20,337,250, 18);
SSCheckBoxView *cbRead = [[SSCheckBoxViewalloc]initWithFrame:cbReadFramestyle:kSSCheckBoxViewStyleGlossychecked:YES];
[cbRead setText:@"已阅读并同意"];
CGRect cbNeverPromptFrame = CGRectMake(20, 355, 250, 18);
SSCheckBoxView *cbNeverPrompt = [[SSCheckBoxViewalloc]initWithFrame:cbNeverPromptFramestyle:kSSCheckBoxViewStyleGlossychecked:YES];
[cbNeverPrompt setText:@"下次不再提示"];
[alert addSubview:lblAnnounce];
[alert addSubview:cbNeverPrompt];
[alert addSubview:cbRead];
[lblAnnounce release];
[cbRead release];
[cbNeverPrompt release];
[alert show];
[alert release];
}
3.另外如果想要checkbox的类的话可以在本站http://download.youkuaiyun.com/detail/sergiowoo/5165349找到,如果你没有积分了,发个email给我说明你想要的:SergioWoo@163.com