How can I make this type of custom EditText UI?
up vote
0
down vote
favorite
I am trying to put borders on edit text and put a label on it. I have tried this one.
<stroke
android:width="2dp"
android:color="@color/colorPrimary"/>
<corners android:radius="15dp"/>
But I want the following one. Initially it will look like this.
After clicking it will be like this.
Would you please help?
android user-interface android-edittext
add a comment |
up vote
0
down vote
favorite
I am trying to put borders on edit text and put a label on it. I have tried this one.
<stroke
android:width="2dp"
android:color="@color/colorPrimary"/>
<corners android:radius="15dp"/>
But I want the following one. Initially it will look like this.
After clicking it will be like this.
Would you please help?
android user-interface android-edittext
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to put borders on edit text and put a label on it. I have tried this one.
<stroke
android:width="2dp"
android:color="@color/colorPrimary"/>
<corners android:radius="15dp"/>
But I want the following one. Initially it will look like this.
After clicking it will be like this.
Would you please help?
android user-interface android-edittext
I am trying to put borders on edit text and put a label on it. I have tried this one.
<stroke
android:width="2dp"
android:color="@color/colorPrimary"/>
<corners android:radius="15dp"/>
But I want the following one. Initially it will look like this.
After clicking it will be like this.
Would you please help?
android user-interface android-edittext
android user-interface android-edittext
edited Nov 9 at 19:03
Kling Klang
32k156286
32k156286
asked Nov 9 at 17:47
Saiful Islam
1
1
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
up vote
1
down vote
use the material design Outline Box style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
this link may help you http://qaru.site/questions/1688917/custom-textinputlayout-android
add a comment |
up vote
0
down vote
As @ZahoorSaleem said, you can use the MaterialComponents for that.
You will need to add the design support library to your build file.
The layout would (simplified) look like this:
<TextInputLayout
android:hint="Label"
style="style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<TextInputEditText />
</TextInputLayout>
add a comment |
up vote
-1
down vote
put the below code in drawable and use this attribute in edittext
android:background="@drawable/nameofdrawablefile"
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#CC0505"/>
<stroke android:width="2dp" android:color="#CC0505" />
<corners android:radius="5dp" />
</shape>
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
use the material design Outline Box style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
this link may help you http://qaru.site/questions/1688917/custom-textinputlayout-android
add a comment |
up vote
1
down vote
use the material design Outline Box style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
this link may help you http://qaru.site/questions/1688917/custom-textinputlayout-android
add a comment |
up vote
1
down vote
up vote
1
down vote
use the material design Outline Box style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
this link may help you http://qaru.site/questions/1688917/custom-textinputlayout-android
use the material design Outline Box style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
this link may help you http://qaru.site/questions/1688917/custom-textinputlayout-android
answered Nov 9 at 17:56
Zahoor Saleem
1997
1997
add a comment |
add a comment |
up vote
0
down vote
As @ZahoorSaleem said, you can use the MaterialComponents for that.
You will need to add the design support library to your build file.
The layout would (simplified) look like this:
<TextInputLayout
android:hint="Label"
style="style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<TextInputEditText />
</TextInputLayout>
add a comment |
up vote
0
down vote
As @ZahoorSaleem said, you can use the MaterialComponents for that.
You will need to add the design support library to your build file.
The layout would (simplified) look like this:
<TextInputLayout
android:hint="Label"
style="style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<TextInputEditText />
</TextInputLayout>
add a comment |
up vote
0
down vote
up vote
0
down vote
As @ZahoorSaleem said, you can use the MaterialComponents for that.
You will need to add the design support library to your build file.
The layout would (simplified) look like this:
<TextInputLayout
android:hint="Label"
style="style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<TextInputEditText />
</TextInputLayout>
As @ZahoorSaleem said, you can use the MaterialComponents for that.
You will need to add the design support library to your build file.
The layout would (simplified) look like this:
<TextInputLayout
android:hint="Label"
style="style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<TextInputEditText />
</TextInputLayout>
edited Nov 9 at 19:01
answered Nov 9 at 18:54
Ridcully
18.1k75171
18.1k75171
add a comment |
add a comment |
up vote
-1
down vote
put the below code in drawable and use this attribute in edittext
android:background="@drawable/nameofdrawablefile"
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#CC0505"/>
<stroke android:width="2dp" android:color="#CC0505" />
<corners android:radius="5dp" />
</shape>
add a comment |
up vote
-1
down vote
put the below code in drawable and use this attribute in edittext
android:background="@drawable/nameofdrawablefile"
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#CC0505"/>
<stroke android:width="2dp" android:color="#CC0505" />
<corners android:radius="5dp" />
</shape>
add a comment |
up vote
-1
down vote
up vote
-1
down vote
put the below code in drawable and use this attribute in edittext
android:background="@drawable/nameofdrawablefile"
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#CC0505"/>
<stroke android:width="2dp" android:color="#CC0505" />
<corners android:radius="5dp" />
</shape>
put the below code in drawable and use this attribute in edittext
android:background="@drawable/nameofdrawablefile"
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#CC0505"/>
<stroke android:width="2dp" android:color="#CC0505" />
<corners android:radius="5dp" />
</shape>
answered Nov 9 at 18:35
Vishal Sharma
1
1
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53230893%2fhow-can-i-make-this-type-of-custom-edittext-ui%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown