Недавно я обновил мою библиотеку поддержки до com.android.support:appcompat-v7:25.1.0
, после чего, если я добавлю текст в EditText
через xml-файл, подсказка TextInputLayout
не будет всплывать.TextInputLayout Hint не плавает после обновления библиотеки поддержки Google
Я также посмотрел this question, но это не сработало для меня.
Вот мой XML-код:
<android.support.design.widget.TextInputLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginRight="16dp"
app:layout_constraintVertical_bias="0.0"
android:id="@+id/til1"
android:layout_marginStart="16dp"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginLeft="16dp"
app:layout_constraintHorizontal_bias="0.33">
<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>
Вот мои Gradle зависимости:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.android.support:cardview-v7:25.1.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.github.bhargavms:DotLoader:1.0.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.labo.kaji:fragmentanimations:0.1.1'
compile 'com.github.esafirm.android-image-picker:imagepicker:1.2.5'
testCompile 'junit:junit:4.12'
}
Это проблема
Вы можете ясно видеть, что намек плавает вверх.
Просим руководствоваться.
Это похоже на серьезную ошибку. У меня нет доступа к последним источникам, но, возможно, они изменили необходимый класс «EditText». Попробуйте использовать «TextInputEditText». –
@MikeM. Такая же проблема с TextInputEditText. –
Да, это известная проблема: http://code.google.com/p/android/issues/detail?id=230171&q=TextInputLayout&sort=-opened&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter% 20Opened. Если вы действительно хотите использовать эту версию библиотеки, кажется, что обходным путем является установка текста в вашем коде. Не идеально, но это может быть немного до того, как он заглянет, поскольку он только что получил сообщение около 10 часов назад. –