我有一个包含一些 EditTexts 的活动.当我单击 EditText 以更改其中的文本时,会在光标出现的位置下方出现一个蓝色箭头.我怎样才能阻止它出现?
I have an activity with some EditTexts in it. When I click on an EditText to change the text in it a blue arrow appears below where the cursor appears. How can I stop this appearing?
正如 MarvinLabs 指出的,它是 Android SDK 中的一组可绘制对象.但它们可以被覆盖.
As MarvinLabs pointed out, it's a set of drawables in the Android SDK. They can be overridden though.
在您的 sdk 平台中找到这些图像:
Find these images in your sdk platform:
将它们复制到你的drawables文件夹,这样你就有一个本地副本可以参考.您可以更改它们的颜色,使它们为空,或任何您想要的.请注意,正如 MarvinLabs 所说,完全删除它们可能并不明智,因为它们会帮助用户选择要剪切和复制的文本.
Copy them over to your drawables folder, so you have a local copy to reference. You can change the colors of these, make them empty, or whatever you want. Note that this as MarvinLabs said, it might not be wise to remove them completely because they help the user select text for cutting and copying.
如果您尚未在您的 styles.xml 中定义自定义主题,请定义一个.然后将这些项目添加到其中:
If you don't have a custom theme yet defined in your styles.xml, define one. Then add these items to it:
_
<style name="CustomTheme" parent="@android:style/Theme.Holo.Light">
<item name="android:textSelectHandleLeft">@drawable/text_select_handle_left</item>
<item name="android:textSelectHandleRight">@drawable/text_select_handle_right</item>
<item name="android:textSelectHandle">@drawable/text_select_handle_middle</item>
</style>
之前:
之后:
(不同的 EditTexts 但你明白了)
(different EditTexts but you get the idea)
这篇关于Android,如何停止出现在 EditText 下方的指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!