当editText的 hint和gravity = “center” 有冲突的时候!

此连接可以解决

http://stackoverflow.com/questions/5387985/android-edittext-for-password-with-androidhint

 

 

 

Hint is displayed correctly with android:inputType="textPassword" andandroid:gravity="center" if you set alsoandroid:ellipsize="start".

 

 

 

 

I had the same issue and found a solution :

Previous code:

    <EditText       android:layout_height="wrap_content"      android:gravity="center"       android:inputType ="password"       android:layout_width="fill_parent"      android:id="@+id/password"       android:hint="password"       android:maxLines="1">      </EditText>  

 

Solution:

<EditText   android:layout_height="wrap_content"  android:gravity="center"   android:password="true"   android:layout_width="fill_parent"  android:id="@+id/password"   android:hint="password"   android:maxLines="1">  </EditText>  

你可能感兴趣的:(android,layout)