是否有非私人API替代方案?
-
05-10-2019 - |
题
由于使用私人API,我的应用程序最近被拒绝(addTextField:
方法 UIAlertView
, ,这很有用,我可能会添加)。
是否有任何非私人替代方案 UIAlertView
没有证件 addTextFieldWithValue:label:
?
非常感谢!
解决方案
创建文本字段作为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];
其他提示
在GitHub上查看此开源代码,以将Uitextfields添加到UialerTview。
不隶属于 StackOverflow