2013-02-11 3 views
0

с textfield.when я нажал на текстовое поле, клавиатура появляется, но не работает means..when я набралась они не видны в текстовом полеклавиатура не работает для UITextField в UIActionSheet

UIActionSheet *menu = [[UIActionSheet alloc] initWithTitle:@"Select reminder date and time" 
                delegate:self 
             cancelButtonTitle:@"Cancel" 
            destructiveButtonTitle:@"Save" 
             otherButtonTitles:nil,nil]; 
menu.tag =10; 
[menu showInView:self.view]; 
UITextField *txtReminderTitle= [[UITextField alloc] initWithFrame:CGRectMake(20.0, 190, 280.0, 40.0)]; 
[txtReminderTitle setTag:99]; 
[txtReminderTitle setBackgroundColor:[UIColor whiteColor]]; 
[txtReminderTitle setFont:[UIFont boldSystemFontOfSize:17]]; 
[txtReminderTitle setBorderStyle:UITextBorderStyleNone]; 
[txtReminderTitle setTextAlignment:UITextAlignmentCenter]; 
txtReminderTitle.borderStyle = UITextBorderStyleRoundedRect; 
txtReminderTitle.keyboardType = UIKeyboardTypeDefault; 
txtReminderTitle.returnKeyType = UIReturnKeyDone; 
txtReminderTitle.delegate =self; 
[menu addSubview:txtReminderTitle]; 

actionsheet появляется Пожалуйста, вытащить меня из этой проблемы. Заранее спасибо.

ответ

0

Я обнаружил, что, когда Вы добавляете UITextField к UIActionSheet тогда UITextField будет оставаться под UIActionSheet так что вам нужно, чтобы отобразить UITextField выше UIActionSheet

Написать следующий код для добавления UITextField:

UIWindow *appWindow = [UIApplication sharedApplication].keyWindow; 
[appWindow insertSubview:txtReminderTitle aboveSubview:menu]; 
Смежные вопросы