Saturday, 2 September 2017

Create Customize Edit_text

step 1:
edittext.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android"    
xmlns:app="http://schemas.android.com/apk/res-auto"    
android:orientation="vertical" 
android:layout_width="match_parent"    
android:layout_height="match_parent"    
android:background="@drawable/background">
<EditText    
android:id="@+id/editText"    
android:backgroundTint="@android:color/white"    
android:textCursorDrawable="@drawable/edit_text"    
android:theme="@style/EditTextTheme"    
android:layout_width="wrap_content"    
android:layout_height="wrap_content"    
android:ems="14"    
android:layout_gravity="center"    
android:inputType="textPersonName"    
android:hint="Email or Phone"/>

<EditText    
android:id="@+id/editText2"    
android:backgroundTint="@android:color/white"    
android:textCursorDrawable="@drawable/edit_text"    
android:theme="@style/EditTextTheme"    
android:layout_width="wrap_content"    
android:layout_height="wrap_content"    
android:ems="14"    
android:layout_gravity="center"    
android:inputType="textPersonName"    
android:hint="Password"/>
</LinearLayout>


step 2:

style.xml
<style name="EditTextTheme" parent="Theme.AppCompat.NoActionBar">
    <item name="colorControlActivated">@android:color/white</item>
</style>

step 3:
edit_text.xml
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" >
    <size android:width="1dp" />
    <solid android:color="#FFFFFF"  />
</shape>


No comments:

Post a Comment

HOW TO CREATE CIRCLE IMAGE VIEW

Step 1: implementation 'de.hdodenhof:circleimageview:3.0.0' Step 2: <de.hdodenhof.circleimageview.CircleImageView xmlns:ap...