I recently updated my support library to com.android.support:appcompat-v7:25.1.0
after which if I add a text to EditText
via xml file the Tex
After updating to version 25.1.0 of the v7 appcompat library, I faced many serious bugs in Toolbar
, RecyclerView
, etc.
I went back to version 25.0.1.
@Rahul Sharma,
Why you are using android:hint="From"
and android:text="09:00 AM"
in EditText tag of xml file?
Instead of that you can use only android:hint="From
in xml file and In Java code u can set text in dynamically.
I hope u will get my point. Thanks.
This issue is fixed in Support Library Version 25.2.0. Please update to 25.2.0 This update includes other major fixes.
https://developer.android.com/topic/libraries/support-library/revisions.html#25-2-0
UPDATE: The issue was fixed in 25.3.1
It is a bug in 25.1.0 https://code.google.com/p/android/issues/detail?id=230171 It seems we have to use previous 25.0.1 version for now.
Check your Do changes like this in you build.gradle for dependencies .. I think gradle is not a problem
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
}
If not solve by changes of gradle change First check basic changes in you inpul layout .. it will defiantly do your text float.. after do your changes.
<android.support.design.widget.TextInputLayout
android:id="@+id/til1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusableInTouchMode="true"
android:layout_margin="10dp">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="From"
android:inputType="time"
android:text="09:00 AM"
android:id="@+id/from_mon"
android:textSize="14sp" />
</android.support.design.widget.TextInputLayout>
NOTE: And if possible set your hint in to string file .. may that will also be the issue.
You must provide hint to the TextInputLayout and use TextInputEditText instead of EditText
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="From">
<android.support.v7.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="09:00 AM" />
</android.support.design.widget.TextInputLayout>