2016-08-24 3 views
1

ImageEditTextの外にdrawableLeftが表示されるのはなぜですか?

EditText/dividerの前にアイコンが表示されるのはなぜですか?

<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:id="@+id/fragment_sign_in" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:padding="5dp" 
tools:context="com.*.*.*.SignInFragment"> 

    <!-- This is the EditText --> 
    <com.rey.material.widget.EditText 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:drawableStart="@drawable/email" 
    android:drawableLeft="@drawable/email" 
    android:padding="0dp" 
    android:hint="test" 
    app:et_dividerHeight="1dp" /> 

</android.support.constraint.ConstraintLayout> 
+0

を。 – Pankaj

答えて

2

あなたはドローアブルとテキストの間

android:drawablePadding="5dp" // Add your own values 

パディングを使用することができます。

は、ここに私のコードです。

は、浮動小数点数は、「14.5sp」としてユニットと が付加された寸法値でなければなりません。使用可能な単位は、px(ピクセル)、dp (密度に依存しないピクセル)、sp(ピクセル単位の縮尺のピクセル )、in(インチ)、mm(ミリメートル)です。

あなたは

android:drawableLeft="2dp" 
android:paddingLeft="3dp" 

とテキストの左側に描画する描画可能に試すことができます。

+1

彼は 'com.rey.material.widget.EditText'を使用しています。このライブラリはこのライブラリに対応していますか? –

+1

@jaydroiderああ。私はそのユーザーカスタムクラスだと思った –

+1

私はこのプロパティは、彼が使用しているライブラリによって認識されないと思うかもしれません。 –

0

enter image description here

私は上記のEditTextのために次のコードを使用:0からいくつかの値にパディングを作る

<EditText 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:drawableStart="@drawable/abc_ic_menu_copy_mtrl_am_alpha" 
     android:drawableLeft="@drawable/abc_ic_menu_copy_mtrl_am_alpha" 
    /> 
+1

彼は 'com.rey.material.widget.EditText'を使っていますが、このライブラリはこの属性をサポートしていないかもしれません。 –

+0

私の問題と同じコードがあれば、これはどのようにして私の問題を解決しますか? –

関連する問題