0

当我使用 Xcode4x 时,我有一个项目以 5.0 的 IOS 目标开始。今天我正在使用 XCode5。

仅在 IOS7 中,在我显示只有一个按钮的 UIAlertView(我将其命名为“确定”的默认取消按钮)后,应用程序将不再在同一视图的任何文本字段中显示闪烁的光标。键盘会出现,我可以编辑文本字段,但不再显示光标。如果我跳到另一个视图上的另一个文本字段,我会得到光标。回到原始视图,触摸一个文本字段,没有光标。

这是我用于警报视图的代码:

            UIAlertView *alertView; // New alertview Test
            alertView = [[UIAlertView alloc] initWithTitle:@"Test Alert" message: @"Test Mesage" delegate: Nil cancelButtonTitle: @"OK" otherButtonTitles: Nil];
           [alertView show]; //

我在 XCode5 中创建了一个针对 IOS6 的新项目,但问题不存在。这在我的项目中。

我希望有人有一些想法。

先感谢您。

4

3 回答 3

3

I have found the exact problem and it is a bug. In Xcode 5.0.1, in my current project or in a brand new project, the GLOBAL TINT COLOR property of the storyboard is not being applied to the UITextField's at launch. It is however being applied on a re-draw, for example in my case when the UIAlertView is dismissed. To prove this, I changed my GLOBAL TINT COLOR to gray. Prior to the UIAlertview the UITextFiled cursor is blue (default). After the UIAlertview the UITextField has changed to gray. I have updated my bug report with Apple.

Just to clarify, initially I was thinking that the cursor was no longer appearing. In fact it was changing colors to white, which is what I had the GLOBAL TINT COLOR set to. Other controls on the interface were being tinted with white in real time in Xcode and at launch. However the UITextFields were not getting tinted until after the app is running and AFTER the UIAlertview was shown and then dismissed.

于 2013-10-31T02:11:47.597 回答
2

这看起来像是 UIKit 中的一个错误。您是否尝试在关闭警报视图后在文本字段上调用 ​​becomeFirstResponder?

于 2013-10-30T16:40:07.253 回答
0

我遇到了同样的问题,在玩了一些设置后发现它归结为将色调设置为颜色而不是默认值。

它必须是一个错误,因为您将闪烁光标的颜色设置为深蓝色并不重要。

通过转到检查器然后向下滚动到查看来找到色调。色调低于背景和 Alpha。

一定要分享这个,因为我在任何地方都没有看到这个问题的答案。

于 2014-07-07T07:49:10.943 回答