私は数年間うまく機能しているプログラムを持っています。突然、iOS 7 にアップグレードすると、機能しなくなりました。UIAlertView 内の RootViewController に UIAlertView (パスワード ダイアログ) を配置しています。UIAlertView は表示されますが、その中の UITextField は表示されません。これが突然機能しなくなる理由についての手がかりはありますか?
短縮コード:
@implementation RootViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Some initialization
if (!firstTimeInit) {
alert =
[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Password",
@"Password")
message:NSLocalizedString(@"EnterPassword",
@"EnterPassword")
delegate:self
cancelButtonTitle:nil
otherButtonTitles:@"OK", nil];
alert.frame = CGRectMake( 0, 0, 300, 260);
UITextField *myTextField =
[[UITextField alloc] initWithFrame:CGRectMake(32.0f, 75.0f,
220.0f, 28.0f)];
myTextField.placeholder = NSLocalizedString(@"Password", @"Password");
[myTextField setSecureTextEntry:YES];
[myTextField setBackgroundColor:[UIColor whiteColor]];
[myTextField setBorderStyle:UITextBorderStyleBezel];
myTextField.tag = 11;
[alert addSubview:myTextField];
CGAffineTransform myTransform =
CGAffineTransformMakeTranslation(0.0, 75.0);
[alert setTransform:myTransform];
[prefs retain];
[alert show];
[myTextField becomeFirstResponder];
}
}