2015-09-09 3 views
1

У меня возникла странная проблема. В моем EditText:несколько курсоров, показанных в Edittext

1) Я могу видеть несколько курсоров, когда пользователь вводит что-либо.

2) Подсказка также видна, даже если пользователь печатает что-то. Пожалуйста, обратитесь к скриншоту

enter image description here

Ниже приводится расположение XML:

<RelativeLayout 
     android:id="@+id/relativeLayout1" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_centerVertical="true" 
     > 

     <AutoCompleteTextView 
      android:id="@+id/actvCountry" 
      style="@style/autoCompleteTextTheme" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginLeft="15dp" 
      android:layout_marginRight="15dp" 
      android:layout_marginTop="15dp" 
      android:background="@drawable/edittext_background" 
      android:hint="@string/select_country_hint" 
      android:singleLine="true" 
      android:textColor="@color/white" 
      android:textColorHint="@color/hint_color" 
      android:textSize="26sp" /> 

     <EditText 
      android:id="@+id/etMobileNumber" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignBaseline="@+id/tvCode" 
      android:layout_alignBottom="@+id/tvCode" 
      android:layout_alignLeft="@+id/tvCode" 
      android:layout_marginRight="15dp" 
      android:background="@drawable/edittext_background" 
      android:ems="10" 
      android:hint="@string/mobile_number" 
      android:inputType="number" 
      android:maxLength="12" 
      android:paddingLeft="80dp" 
      android:singleLine="true" 
      android:textColor="@color/white" 
      android:textColorHint="@color/hint_color" 
      android:textSize="26sp" > 

      <requestFocus /> 
     </EditText> 

     <TextView 
      android:id="@id/tvCode" 
      style="@style/editTextTheme" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_below="@id/actvCountry" 
      android:layout_margin="15dp" 
      android:singleLine="true" 
      android:text="" 
      android:textColor="@color/white" 
      android:textColorHint="@color/white" 
      android:textSize="26sp" /> 

     <TextView 
      android:id="@+id/tvMsg" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignLeft="@+id/etMobileNumber" 
      android:layout_below="@id/etMobileNumber" 
      android:layout_marginBottom="15dp" 
      android:layout_marginRight="2dp" 
      android:layout_marginTop="10dp" 
      android:ellipsize="marquee" 
      android:text="@string/enter_country_code_mobile" 
      android:textColor="@color/white" 
      android:textColorHint="@color/white" /> 

     <Button 
      android:id="@+id/btnProceed" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_below="@id/tvMsg" 
      android:layout_margin="15dp" 
      android:background="@drawable/ripple_button_selector" 
      android:padding="7dp" 
      android:text="@string/login" 
      android:textAllCaps="false" 
      android:textColor="@color/white" 
      android:textSize="26sp" /> 
    </RelativeLayout> 

Ниже фон устанавливается в EditText (edittext_background.xml)

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" > 
<stroke 
    android:width="2dip" 
    android:color="@color/white" /> 
<padding 
    android:bottom="5dip" 
    android:left="5dip" 
    android:right="10dip" 
    android:top="5dip" /> 

Любое предложение приветствуются.

+0

вы можете загрузить больше XML-код? – Umair

+0

загрузил полный XML –

+0

Я вижу, что ваш код в порядке ... попробуйте очистить и перестроить проект .. – Mohit

ответ

1

Я не знаю, почему возникла проблема, но она была решена после изменения моего edittext_background. Я добавил прозрачный фон. Новый XML является:

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" > 
<stroke 
    android:width="2dip" 
    android:color="@color/white" /> 
<solid android:color="#00000000" /> 
<padding 
    android:bottom="5dip" 
    android:left="5dip" 
    android:right="10dip" 
    android:top="5dip" /> 

+0

Я действительно ненавижу ненависть ненависть ненависть ненависть ненависть ненависть ненависть ненависть ненависть ненависть ненависть HAAAATTTTEEEEE андроид так много ...... спасибо огромное Sulabh ....! – Lichtamberg

Смежные вопросы