久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

使用 TextInputLayout 時出現(xiàn) InflateException

InflateException when using TextInputLayout(使用 TextInputLayout 時出現(xiàn) InflateException)
本文介紹了使用 TextInputLayout 時出現(xiàn) InflateException的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我正在嘗試使用 Material Design 中的 TextInputEditText (https://github.com/material-components/material-components-android/blob/master/docs/components/TextInputLayout.md),我遇到了運行時異常.

I'm trying to use TextInputEditText from Material Design (https://github.com/material-components/material-components-android/blob/master/docs/components/TextInputLayout.md) and I'm getting runtime exception.

這是運行日志的一部分:

This's part of run log:

E/AndroidRuntime: FATAL EXCEPTION: main
              Process: com.example.grigori.materialtextedit, PID: 12036
              java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.grigori.materialtextedit/com.example.grigori.materialtextedit.MainActivity}: android.view.InflateException: Binary XML file line #9: Binary XML file line #9: Error inflating class com.google.android.material.textfield.TextInputLayout
                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
                  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
                  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
                  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
                  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
                  at android.os.Handler.dispatchMessage(Handler.java:106)
                  at android.os.Looper.loop(Looper.java:193)
                  at android.app.ActivityThread.main(ActivityThread.java:6669)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
               Caused by: android.view.InflateException: Binary XML file line #9: Binary XML file line #9: Error inflating class com.google.android.material.textfield.TextInputLayout
               Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class com.google.android.material.textfield.TextInputLayout
               Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.material.textfield.TextInputLayout" on path: DexPathList

我通過 DexPathList 剪切了這個日志,其中包含許多 apk 文件的路徑,例如:

I cut this log by DexPathList that contains many paths to apk files, like:

zip file "/data/app/com.example.grigori.materialtextedit-jamgTcrgG9neBKIMcqDo7Q==/base.apk"

我的 xml 文件:

<android.support.constraint.ConstraintLayout 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"
tools:context=".MainActivity">

<com.google.android.material.textfield.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <com.google.android.material.textfield.TextInputEditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/hint_text"/>

</com.google.android.material.textfield.TextInputLayout>

我的 build.gradle 依賴:

My build.gradle dependences:

    dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'}     

推薦答案

在我現(xiàn)有的項目中實現(xiàn) AndroidX 時遇到了這個問題.

Faced this issue when implementing AndroidX in my existing project.

implementation 'com.google.android.material:material:1.0.0-beta01'

布局 XML

<com.google.android.material.textfield.TextInputLayout
    android:id="@+id/userNameWrapper"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/TextLabel">

舊式

<style name="TextLabel" parent="TextAppearance.AppCompat">
        <item name="android:textColorHint">@color/hint_color</item>
        <item name="android:textSize">@dimen/text_20sp</item>
        <item name="colorControlNormal">@color/primaryGray</item>
        <item name="colorControlActivated">@color/colorPrimary</item>
    </style>

新風格

<style name="TextLabel" parent="Widget.MaterialComponents.TextInputLayout.FilledBox">
        <item name="android:textColorHint">@color/hint_color</item>
        <item name="android:textSize">@dimen/text_20sp</item>
        <item name="colorControlNormal">@color/primaryGray</item>
        <item name="colorControlActivated">@color/colorPrimary</item>
    </style>

這篇關于使用 TextInputLayout 時出現(xiàn) InflateException的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯(lián)網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!

相關文檔推薦

Cut, copy, paste in android(在android中剪切、復制、粘貼)
android EditText blends into background(android EditText 融入背景)
Change Line Color of EditText - Android(更改 EditText 的線條顏色 - Android)
EditText showing numbers with 2 decimals at all times(EditText 始終顯示帶 2 位小數(shù)的數(shù)字)
Changing where cursor starts in an expanded EditText(更改光標在展開的 EditText 中的開始位置)
EditText, adjustPan, ScrollView issue in android(android中的EditText,adjustPan,ScrollView問題)
主站蜘蛛池模板: 亚洲成人av| 欧美a级成人淫片免费看 | 欧美黄色片| 欧美日韩综合一区 | 午夜视频在线观看一区二区 | 日韩欧美手机在线 | 中文av网站| av久久| 在线国产视频观看 | 91精品一区二区三区久久久久 | 日韩在线 | 风间由美一区二区三区在线观看 | 精品国产一区久久 | 中文字幕视频在线观看免费 | 国产清纯白嫩初高生视频在线观看 | a黄视频| 成人在线视频网 | 久久国产精品久久国产精品 | 亚洲黄色片免费观看 | av在线播放一区二区 | 天天看天天操 | 免费观看的av | 亚洲欧洲精品成人久久奇米网 | 在线视频一区二区 | 欧美精品久久久久 | 亚洲欧美在线观看 | 夜久久 | 国产精品不卡一区 | 999久久久久久久久6666 | 亚洲精品久久嫩草网站秘色 | 香蕉二区| 狠狠的干狠狠的操 | 欧美电影大全 | 九九久久精品视频 | 国产精品美女久久久久久免费 | 亚洲精品久久久蜜桃网站 | 国产女人第一次做爰毛片 | 日韩在线免费观看视频 | 亚洲 欧美 激情 另类 校园 | 久久久女女女女999久久 | 一区二区三区四区视频 |