android - Left Icon in TextInputLayout -
i'm trying add left icon textinputlayout, text on icon. when add padding, move together.
i tried
android:drawableleft="@drawable/ic_store_white_48dp" android:drawablepadding="50dp" android:drawablestart="@drawable/ic_store_white_48dp"
but not working ! should implement linearlayout horizontal each row, sure there no easier way it
here code layout:
<android.support.design.widget.textinputlayout android:id="@+id/til_calle" android:layout_width="match_parent" android:layout_height="wrap_content"> <edittext android:id="@+id/et_calle" android:layout_width="fill_parent" android:layout_height="wrap_content" android:drawableleft="@drawable/ic_store_white_48dp" android:drawablepadding="50dp" android:drawablestart="@drawable/ic_store_white_48dp" android:hint="calle" android:inputtype="text" /> </android.support.design.widget.textinputlayout>
make sure using latest design
library, need both design
, appcompat
is:
compile 'com.android.support:design:23.2.0'
try using both design's library textinputlayout
, appcompat's appcompatedittext
.
<android.support.design.widget.textinputlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:textcolor="@android:color/white" android:textcolorhint="@color/loginhint"> <android.support.v7.widget.appcompatedittext android:layout_width="wrap_content" android:layout_height="wrap_content" android:imeoptions="actionnext" android:inputtype="textemailaddress|textnosuggestions" android:minwidth="350dp" android:drawableleft="@drawable/ic_store_white_48dp" android:drawablestart="@drawable/ic_store_white_48dp" android:textcolor="@android:color/white" android:textcolorhint="@color/loginhint" android:textcursordrawable="@null" app:backgroundtint="@android:color/white"/> </android.support.design.widget.textinputlayout>
Comments
Post a Comment