2014-10-31 41 views
0

我做了一個簡單的演示自動完成。它工作正常我需要在UI中的一些問題。如何使遊標在Android中變黑

請檢查圖像的自動提示一下..

這裏是我的代碼..

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:background="@drawable/bg1" > 

    <TextView 
     android:id="@+id/textView1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentTop="true" 
     android:layout_marginLeft="28dp" 
     android:layout_marginTop="42dp" 
     android:text="@string/chooseStation" 
     android:textColor="#000000" 
     android:textAppearance="?android:attr/textAppearanceMedium" /> 

    <Button 
     android:id="@+id/item_buttonId" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerHorizontal="true" 
     android:layout_centerVertical="true" 
     android:text="@string/okButton" /> 

    <AutoCompleteTextView 
     android:id="@+id/item_autoComplete" 
     android:layout_width="150dp" 
     android:layout_height="wrap_content" 
     android:layout_alignBaseline="@+id/textView1" 
     android:layout_alignBottom="@+id/textView1" 
     android:layout_alignParentRight="true" 

     android:textColor="#000000" /> 

</RelativeLayout> 

主要關注的問題是這樣的代碼:

<AutoCompleteTextView 
      android:id="@+id/item_autoComplete" 
      android:layout_width="150dp" 
      android:layout_height="wrap_content" 
      android:layout_alignBaseline="@+id/textView1" 
      android:layout_alignBottom="@+id/textView1" 
      android:layout_alignParentRight="true" 

      android:textColor="#000000" /> 

其實第一個問題是,我的光標成爲白色它是不可見的。第二如何使文本字段中的矩形,使其看起來不錯。在我看來,它只顯示基線。第三如何給予填充,使其不接觸Wi的終點嗞..

enter image description here

+1

[Set EditText cursor color]的可能重複(http://stackoverflow.com/questions/7238450/set-edittext-cursor-color) – 2014-10-31 17:24:39

回答

0

設置android:textCursorDrawable屬性@null

然後,光標將有android:textColor值的顏色。