Skip to main content

I want to implement this type of layout of input text with float lable but problem is when I run application it not look same and lable appear upper side of input text field.

I want to implement this type of layout of input text with float lable but problem is when I run application it not look same and lable apper upper side of input text fieldenter image description here

But, this is my result

this is my result enter image description here

My code is:

roundview.xml.

enter code here roundview.xml <?xml version="1.0" encoding="utf-8"?>  <selector xmlns:android="http://schemas.android.com/apk/res/android">   <item>   <shape android:shape="rectangle">   <solid android:color="#ffffff"/>   <corners android:radius="10dp" />        <stroke  <stroke  android:width="2dp"  android:color="#3bbdfa"width="2dp"   />  </shape>android:color="#3bbdfa" </item> </selector> enter code here <?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"  xmlns:tools="http://schemas.android.com/tools"  android:layout_width="match_parent"/> android:layout_height="match_parent"  android:filterTouchesWhenObscured="false"  android:labelFor="@+id</editText3" android:touchscreenBlocksFocus="true"shape> android:orientation="vertical"  android:padding="16dp"</item> tools:context="com.example.mahtb.fypapp.login"> </selector>   

<android.support.design.widget.TextInputLayout   android:id="@+id/text"   android:layout_width="match_parent"   android:layout_height="wrap_content"   app:errorEnabled="true">   <android.support.design.widget.TextInputEditText   android:id="@+id/edittxt"   android:layout_width="match_parent"   android:layout_height="130dp"   android:background="@drawable/roundview"   android:fadeScrollbars="false"   android:fadingEdge="vertical"   android:foregroundGravity="fill_vertical"   android:hint="name"   android:isScrollContainer="false"   android:requiresFadingEdge="vertical"   android:singleLine="false"   android:visibility="visible" />  </android.support.design.widget.TextInputLayout>   </LinearLayout> 

I follwfollow https://material.io/design for text fields design but I got this problem.thanks

I want to implement this type of layout of input text with float lable but problem is when I run application it not look same and lable apper upper side of input text field

this is my result

enter code here roundview.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <solid android:color="#ffffff"/> <corners android:radius="10dp" />     <stroke  android:width="2dp"  android:color="#3bbdfa"   />  </shape> </item> </selector> enter code here <?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"  xmlns:tools="http://schemas.android.com/tools"  android:layout_width="match_parent" android:layout_height="match_parent"  android:filterTouchesWhenObscured="false"  android:labelFor="@+id/editText3" android:touchscreenBlocksFocus="true" android:orientation="vertical"  android:padding="16dp" tools:context="com.example.mahtb.fypapp.login">   <android.support.design.widget.TextInputLayout   android:id="@+id/text"   android:layout_width="match_parent"   android:layout_height="wrap_content"   app:errorEnabled="true">   <android.support.design.widget.TextInputEditText   android:id="@+id/edittxt"   android:layout_width="match_parent"   android:layout_height="130dp"   android:background="@drawable/roundview"   android:fadeScrollbars="false"   android:fadingEdge="vertical"   android:foregroundGravity="fill_vertical"   android:hint="name"   android:isScrollContainer="false"   android:requiresFadingEdge="vertical"   android:singleLine="false"   android:visibility="visible" />  </android.support.design.widget.TextInputLayout>   </LinearLayout> 

I follw https://material.io/design for text fields design but I got this problem.thanks

I want to implement this type of layout of input text with float lable but problem is when I run application it not look same and lable appear upper side of input text field.

enter image description here

But, this is my result

enter image description here

My code is:

roundview.xml.

 <?xml version="1.0" encoding="utf-8"?>  <selector xmlns:android="http://schemas.android.com/apk/res/android">   <item>   <shape android:shape="rectangle">   <solid android:color="#ffffff"/>   <corners android:radius="10dp" />    <stroke  android:width="2dp" android:color="#3bbdfa" /> </shape> </item> </selector>  

<android.support.design.widget.TextInputLayout android:id="@+id/text" android:layout_width="match_parent" android:layout_height="wrap_content" app:errorEnabled="true"> <android.support.design.widget.TextInputEditText android:id="@+id/edittxt" android:layout_width="match_parent" android:layout_height="130dp" android:background="@drawable/roundview" android:fadeScrollbars="false" android:fadingEdge="vertical" android:foregroundGravity="fill_vertical" android:hint="name" android:isScrollContainer="false" android:requiresFadingEdge="vertical" android:singleLine="false" android:visibility="visible" /> </android.support.design.widget.TextInputLayout> 

I follow https://material.io/design for text fields design but I got this problem.thanks

edited tags
Link
Phantômaxx
  • 38.1k
  • 21
  • 88
  • 122
Source Link

Implementation Outlined text field Input with lable text in android application

I want to implement this type of layout of input text with float lable but problem is when I run application it not look same and lable apper upper side of input text field

this is my result

enter code here roundview.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <solid android:color="#ffffff"/> <corners android:radius="10dp" /> <stroke android:width="2dp" android:color="#3bbdfa" /> </shape> </item> </selector> enter code here <?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" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:filterTouchesWhenObscured="false" android:labelFor="@+id/editText3" android:touchscreenBlocksFocus="true" android:orientation="vertical" android:padding="16dp" tools:context="com.example.mahtb.fypapp.login"> <android.support.design.widget.TextInputLayout android:id="@+id/text" android:layout_width="match_parent" android:layout_height="wrap_content" app:errorEnabled="true"> <android.support.design.widget.TextInputEditText android:id="@+id/edittxt" android:layout_width="match_parent" android:layout_height="130dp" android:background="@drawable/roundview" android:fadeScrollbars="false" android:fadingEdge="vertical" android:foregroundGravity="fill_vertical" android:hint="name" android:isScrollContainer="false" android:requiresFadingEdge="vertical" android:singleLine="false" android:visibility="visible" /> </android.support.design.widget.TextInputLayout> </LinearLayout> 

I follw https://material.io/design for text fields design but I got this problem.thanks