2010-09-24 75 views
2

我的应用程序最近因使用私有API而被拒绝(addTextField:方法适用于UIAlertView,这非常有用,我可以添加)。任何非私有API的替代品?

是否有任何非私人的替代UIAlertView的无证addTextFieldWithValue:label:

非常感谢!

回答

3

创建文本字段作为UIAlertView中

// Ask for Username and password. 
alertView = [[UIAlertView alloc] initWithTitle:_title message:@"\n \n \n" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; 
// Adds a username Field 
utextfield = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 25.0)]; 
utextfield.placeholder = @"Username"; 
[utextfield setBackgroundColor:[UIColor whiteColor]]; 
utextfield.enablesReturnKeyAutomatically = YES; 
[utextfield setReturnKeyType:UIReturnKeyDone]; 
[utextfield setDelegate:self]; 
[alertView addSubview:utextfield]; 

// Show alert on screen. 
[alertView show]; 
[alertView release]; 
+1

好戏。 (小记:错过了utextfield的发布。) – 2010-09-24 05:26:30

+0

非常感谢!希望现在我不必等待两个星期才能有人拒绝我的应用程序。 – esqew 2010-09-24 19:29:15