我有一個建立在Xcode的4.6和iOS 6。我使用它5的XCode輸入文本使用彈出在IOS 7
現在升級到iOS 7的應用程序,我有這樣的代碼完全上工作iOS 6.它會帶來一個帶有UITextField的彈出窗口。用戶可以輸入他們想要的任何文本並點擊確定。我把他們的文本放在UILabel中。
我的問題是,在iOS 7中,當我彈出這個彈出文本框,它不可編輯。觸摸它不會做任何事情。怎麼來的?
下面是代碼和截圖
// ************
// ENTER TEXT
// ************
-(IBAction)insertText
{
UIAlertView* dialog = [[UIAlertView alloc] initWithTitle:@"Enter Text \n"
message:@"\n\n Keep it short and sweet"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"OK", nil];
nameField = [[UITextField alloc] initWithFrame:CGRectMake(20.0, 45.0, 245.0, 25.0)];
[nameField setBackgroundColor:[UIColor whiteColor]];
[dialog addSubview:nameField];
[dialog show];
}
以供將來參考 - http://stackoverflow.com/questions/6319417/whats-a-simple-way-to-get-a-text-input-popup-dialog-box-on-an-iphone –