29,030
社区成员
发帖
与我相关
我的任务
分享
for (UIView *Outlet in [alertView subviews]) {
if([Outlet isKindOfClass:[UIButton class]])
{
UIButton* button = (UIButton*)Outlet;
button.frame = CGRectMake(button.frame.origin.x, button.frame.origin.y+100,button.frame.size.width , button.frame.size.height);
}
}
UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Test:"
message: @"\n\n\n\n\n"
delegate: self
cancelButtonTitle: @"OK"
otherButtonTitles: @"Cancel",nil];
UITextView *textView = [[UITextView alloc] initWithFrame: CGRectMake(12.0, 45.0, 250.0, 120.0)];
textView.layer.cornerRadius = 6;
textView.layer.masksToBounds = YES;
[alert setTransform: CGAffineTransformMakeTranslation(0.0, -100)];
[alert addSubview: textView];
[alert show];
- (void)willPresentAlertView:(UIAlertView *)alertView
{
if([alertView tag] == 5003 || [alertView tag] == 5004)
{
alertView.frame = CGRectMake(alertView.frame.origin.x, alertView.frame.origin.y-80,alertView.frame.size.width , alertView.frame.size.height+100);
UITextView *contentView = [[UITextView alloc]initWithFrame:CGRectMake(alertView.frame.origin.x, alertView.frame.origin.y-115,alertView.frame.size.width-40, 100)];
[contentView setTag:2014];
[alertView addSubview:contentView];
for (UIView *Outlet in [alertView subviews]) {
if([Outlet isKindOfClass:[UIButton class]])
{
UIButton* button = (UIButton*)Outlet;
button.frame = CGRectMake(button.frame.origin.x, button.frame.origin.y+100,button.frame.size.width , button.frame.size.height);
[alertView bringSubviewToFront:button];
}
}
}
}
for (UIView *Outlet in [alertView subviews]) {
if([Outlet isKindOfClass:[UIButton class]])
{
UIButton* button = (UIButton*)Outlet;
button.frame = CGRectMake(button.frame.origin.x, button.frame.origin.y+100,button.frame.size.width , button.frame.size.height);
//在这加上
[alertView bringSubviewToFront button];
}
}