标签:
CustomIOS7AlertView *alert = [[CustomIOS7AlertViewalloc] init];
UIView *mainView = [[UIViewalloc] initWithFrame:CGRectMake(0,0, 280, 140)];
UIImageView *imgView = [[UIImageViewalloc] initWithFrame:CGRectMake(10,10, 20, 20)];
[imgViewsetImage:[UIImageimageNamed:@"log-120.png"]];
UILabel *labelaAppName = [[UILabelalloc] initWithFrame:CGRectMake(35,10, 100, 20)];
[labelaAppName setBackgroundColor:[UIColorclearColor]];
labelaAppName.text =@"测试";
UILabel *labelContext = [[UILabelalloc] initWithFrame:CGRectMake(10,40, 260, 90)];
labelContext.text = message;
[labelContext setFont:[UIFontsystemFontOfSize:14]];
[labelContext setBackgroundColor:[UIColorclearColor]];
[labelContext setTextAlignment:NSTextAlignmentLeft];
labelContext.lineBreakMode =NSLineBreakByWordWrapping;
labelContext.numberOfLines =0;
[labelContextsizeToFit];
[labelContextsetCenter:CGPointMake(140.0, labelContext.center.y)];
[mainViewsetFrame:CGRectMake(mainView.frame.origin.x, mainView.frame.origin.y,280.0, labelContext.frame.origin.y + labelContext.frame.size.height + 14.0)];
[mainViewaddSubview:imgView];
[mainViewaddSubview:labelaAppName];
[mainViewaddSubview:labelContext];
[alert setButtonTitles:@[@"确定"]];
[alertsetContainerView:mainView];
[alertsetOnButtonTouchUpInside:^(CustomIOS7AlertView *alertView,int buttonIndex){
[alertViewclose];
}];
[alertshow];
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:
原文地址:http://blog.csdn.net/liuyinghui523/article/details/47044027