实现 UIAlertView 重新布局,改变大小,设置坐标
1:首先实现 其 delegate
2:实现 -(void)willPresentAlertView:(UIAlertView *)alertView 方法,在这里设置
//this code for iPad .
#pragma mark - alert delegate
-(void)willPresentAlertView:(UIAlertView *)alertView{
CGSize size=[[CCDirectorsharedDirector]winSize];
alertView.frame=CGRectMake(size.width/768*204, size.height/1024*312, size.width/768*360, size.height/1024*200);
for (UIView * viewin [alertView subviews]) {
if ([view isKindOfClass:[UILabelclass]]) {
UILabel* label = (UILabel*) view;
label.frame=CGRectMake(18,10, 330, 100);
label.font=[UIFontfontWithName:@"Verdana-Bold" size:19];
label.textAlignment=UITextAlignmentCenter;
}
if ([view isKindOfClass:[UIButtonclass]]) {
UIButton * button=(UIButton *)view;
button.frame=CGRectMake(80,130, 200, 50);
}
}
}