在安卓的EditText文本光标 [英] Android text cursor in EditText

查看:106
本文介绍了在安卓的EditText文本光标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写的的Andr​​oid 2.1 +应用程序。在我的活动我有的EditText 自定义键盘(KeyboardView与键映射在keyboard.xml)。一切都运行完美关于的Andr​​oid 2.1 (一切正常显示 - 文本光标闪烁),问题开始的安卓2.3.3 ,其中的TextCursor中的EditText 是可见的,但不闪烁,并在安卓3.0 + 文本光标刚无形 - 在这两种情况下的键盘是否正常工作。我挣扎着从几天这个问题...任何想法将是非常有益的。

I'm writing an application for android 2.1+. In one of my activities i have EditText with custom keyboard (KeyboardView with key mappings in keyboard.xml). Everything works perfect on android 2.1 ( everything is shown correctly - text cursor is flashing), problems start on android 2.3.3 where textcursor in edittext is visible but not blinking, and on android 3.0+ text cursor is just invisible - in both cases keyboard is working correctly. I'm struggling with this problem from couple days... any thoughts would be really helpful.

还有,我应该更早提及的一件事。本次活动分为两个片段(Android的支持库)的EditText是其中之一,并且键盘是从父活动调用。

There is one thing which i should mention earlier. This activity is split into two fragments (android support library), EditText is on one of them, and the keyboard is called from parent activity.

推荐答案

在我之前遇到过这个问题,解决方法是关闭硬件加速,在包含编辑文本的活动,通过修改清单是这样的:

When i faced this problem before, the solution was to disable hardware acceleration on the activity that contains the edit text, by modifying the manifest like this:

<activity android:name="activity name" android:hardwareAccelerated="false"/>

这篇关于在安卓的EditText文本光标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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