我在UIalterView中添加了个 UITextView 用下面的代码对 确定跟取消按钮调位置 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);
}
}在模拟器上运行 效果正常 但在真机上按钮会给UITextView挡住 请问下要怎么修改 是否是IOS版本的问题?
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);
}
}在模拟器上运行 效果正常 但在真机上按钮会给UITextView挡住 请问下要怎么修改 是否是IOS版本的问题?
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];
}
}
{
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];
}
}
}}
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];我不知道你要的是不是这种效果