是否有任何非私有API替代方案? [英] Any non-private API alternative for this?
本文介绍了是否有任何非私有API替代方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的应用最近由于使用私有API而被拒绝(UIAlertView
的addTextField:
方法非常有用,我可以添加).
My app was recently rejected due to using a private API (addTextField:
method for UIAlertView
, which is quite useful, might I add).
UIAlertView
的未记录的addTextFieldWithValue:label:
是否有任何非私有替代品?
Is there any non-private alternative to UIAlertView
's undocumented addTextFieldWithValue:label:
?
非常感谢!
推荐答案
将文本字段创建为UIAlertView的子视图
create the text field as a subview of the 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];
这篇关于是否有任何非私有API替代方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文