Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/232.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 在文本字段上看不到光标_Android_Android Layout_Android Edittext - Fatal编程技术网

Android 在文本字段上看不到光标

Android 在文本字段上看不到光标,android,android-layout,android-edittext,Android,Android Layout,Android Edittext,嗨,我在文本字段上看不到插入符号。即使我可以输入它,但没有光标是有误导性的 我在API15到API19上试过这个 文本字段如下所示: <EditText android:id="@+id/login" style="@style/LoginEditText" android:completionThreshold="1" android:imeOptions="actionNex

嗨,我在文本字段上看不到插入符号。即使我可以输入它,但没有光标是有误导性的

我在API15到API19上试过这个

文本字段如下所示:

        <EditText
            android:id="@+id/login"
            style="@style/LoginEditText"
            android:completionThreshold="1"
            android:imeOptions="actionNext"
            android:inputType="textEmailAddress"
            android:nextFocusDown="@+id/pwd"
            />

<style name="LoginEditText" parent="EditText">
    <item name="android:layout_width">match_parent</item>
    <item name="android:layout_height">wrap_content</item>
    <item name="android:autoText">false</item>
    <item name="android:capitalize">none</item>
    <item name="android:scrollHorizontally">true</item>
    <item name="android:singleLine">true</item>
    <item name="android:textSize">20sp</item>
</style>

<style name="EditText" parent="Global">
    <item name="android:textColor">@color/text</item>
    <item name="android:textSize">14sp</item>
    <item name="android:padding">10dp</item>
    <item name="android:layout_margin">10dp</item>
</style>
<style name="Global">
    <item name="android:layout_height">wrap_content</item>
    <item name="android:layout_width">wrap_content</item>
</style>
<color name="text">#ff000000</color>

匹配父项
包装内容
假的
没有一个
真的
真的
20便士
@颜色/文字
14便士
10dp
10dp
包装内容
包装内容
#ff000000
我的主题中的设置

<style name="App_EditTextStyle" parent="@android:style/Widget.EditText">
    <item name="android:textColor">#808080</item>
    <item name="android:layout_height">45dip</item>
    <item name="android:background">#FFFFFF</item>
</style>

#808080
45度
#FFFFFF
我希望edittextfield的背景为白色。所以可能光标也是白色的……我不确定


如果我移除
#FFFFFF
,那么我确实看到了光标,但是,背景不再是我希望的白色

使用
android:textCursorDrawable=“@null”
android:textColor

像这样做

<?xml version="1.0" encoding="utf-8"?>
   <EditText xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="This is a template"
    android:background="#ffffff"
    android:textColor="#000000"
    android:cursorVisible="true"
    android:textCursorDrawable="@null" />


你指的是光标???尝试为编辑文本添加
android:cursorVisible=“true”
。请参见上述链接中的答案。Lal提供的链接中有几个选项。另一个是指定可绘制的“颜色光标”,然后提供
textCursorDrawable=“@drawable/color\u cursor”
@伯迪,我建议你看看你的选择。