如何自定义UIAlertView?苹果会批准吗?
我使用自定义 UIAlertView
和 UITextField
从用户那里获取密码。
我被告知这个自定义视图可能会导致我的应用程序被 Apple 拒绝;这是正确的吗?如果是这样,我的自定义控件的合适替代品是什么?
I am using a custom UIAlertView
with UITextField
to get password from the user.
I have been told that this custom view may cause my App to get reject by Apple; is that correct? If so, what is the appropriate replacement for my custom control?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
您可以将文本字段添加到 UIAlertView
You can add a textfield to your UIAlertView
请参阅我的 博客文章 执行此操作及其完全接受的代码由苹果公司。我在我的一些应用程序中添加了这个,它们都被接受了。所以使用它不用担心!
这是您可以使用的代码:
See my blog post of doing this and its perfectly accepted code by apple. I added this in some of my apps and they all got accepted. So use it without fear!!
Here is the code you can use :
查看下面的博客教程以获取完整的解决方案。
http://junecloud .com/journal/code/displaying-a-password-or-text-entry-prompt-on-the-iphone.html?cmd=success#comment3870
Check below blog tutorial for the complete solution.
http://junecloud.com/journal/code/displaying-a-password-or-text-entry-prompt-on-the-iphone.html?cmd=success#comment3870
如果您担心被拒绝,您可以随时滚动自己的视图,该视图具有类似于
UIAlertView
的动画。在这里查看这个问题:如何自定义 iOS 警报视图?
If you're concerned about rejection, you can always roll your own view that has animations similar to a
UIAlertView
. Check this question out here:How can I customize an iOS alert view?
iOS 5 现在原生支持此功能。查看 UIAlertView 的
alertViewStyle
属性。iOS 5 now supports this natively. Check out UIAlertView's
alertViewStyle
property.引用类参考
在我看来,最后一句话是他们不希望开发人员修改视图。
Quoting from the class reference
The last sentence appears to me that they don't want developers modifying the views.
我认为有更好的方法来解决这个问题。这是代码片段
(您可以在 prodeveloper 博客中找到相关实现)
但这在 iOS 5.0 及更高版本上运行良好仅有的。请记下它。苹果肯定会批准它。
I think there is a better way to solve this. Here is the code snippet
(You can find related implementations in prodeveloper blog)
But this works fine on iOS 5.0 and above only. Please make a note of it. And Apple will certainly approve it.
Apple 批准了 UIAlertview 的定制。
从 iOS 5.0 开始,苹果提供了 Alertview 类型来获取凭据输入。
这里我列出了一个自定义的alertview,它可以在旧的ios版本和方向上工作
自定义警报视图
谢谢,
Naveen Shan
Ya Apple approve the customization of UIAlertview.
From iOS 5.0 apple gives alertview type to take credential input.
Here I listed a custom alertview which is able to work on older ios version and orientation
custom alertview
thanks,
Naveen Shan