iOS5:有人设法修复UIAlertView三个按钮和文本字段(UIAlertViewStylePlainTextInput)? [英] iOS5: Has somebody managed to fix UIAlertView with three buttons and textfield (UIAlertViewStylePlainTextInput)?

查看:303
本文介绍了iOS5:有人设法修复UIAlertView三个按钮和文本字段(UIAlertViewStylePlainTextInput)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

苹果真的搞砸了这个。我想用新的 UIAlertViewStylePlainTextInput 风格使用 UIAlertView ,并且有三个按钮。结果如下:

Apple really screwed this one up. I want to use a UIAlertView with the new UIAlertViewStylePlainTextInput style and have three buttons in it. The result looks as follows:

有人设法建立一个解决方法,直到苹果公司解决这个问题?也许减少按钮高度不知何故或增加警报视图的总高度?

Has somebody managed to build a workaround until Apple will have fixed this issue? Maybe reducing the button height somehow or increase the total height of the alert view?

推荐答案

这不是一个完整的解决方案,让您开始。

This is not a complete solution but it may get you started.

UIAlertView view = new UIAlertView ("Alert", "This is an alert\n\n\n", null, "Login", "One", "Two");

UIView theTextField = new UIView (new RectangleF (12.0f, 80.0f, 260.0f, 25.0f));
UITextView txt = new UITextView (new RectangleF (0f, 0f, 260.0f, 25.0f));
txt.BackgroundColor = UIColor.White;
theTextField.AddSubview (txt);
view.AddSubview (theTextField); 

view.Show ();

我观察到当你添加一个文本视图作为一个子视图时,AlertView试图聪明。但是如果你把一个通用的UIView作为一个容器,它给你一些更有用的东西。

I observed that the AlertView tries to be intelligent when you add a text view as a sub view. But if you put a generic UIView in as a container it gives you something more useable.

我也验证了这是XCode中的一个问题。

I also verified that this is a problem in XCode.

帖子可能会为您提供更多建议。

This post may give you some more ideas.

这篇关于iOS5:有人设法修复UIAlertView三个按钮和文本字段(UIAlertViewStylePlainTextInput)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆