繁体   English   中英

运行活动时出现 TextInputEditText 错误

[英]TextInputEditText error when running acitivity

android.view.InflateException:二进制 XML 文件第 107 行:错误膨胀类 android.support.design.widget.TextInputEditText

这是我的 gradle 版本:

dependencies {

implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:28.0.0-alpha1'
implementation 'com.android.support:design:28.0.0-alpha1'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.1.0'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

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'

}

XML文件

      <android.support.design.widget.TextInputLayout
        android:id="@+id/loginEtEmailLayout"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:background="@drawable/bg_round_white"
        app:layout_constraintTop_toTopOf="@id/textLogin"
        app:layout_constraintBottom_toTopOf="@id/loginEtPasswordLayout"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintVertical_bias="0.5"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintVertical_chainStyle="packed"
        app:hintEnabled="false"
        app:errorEnabled="false"
        android:layout_marginStart="5dp"
        android:layout_marginEnd="5dp">

        <android.support.design.widget.TextInputEditText
            android:id="@+id/loginEtEmail"
            android:layout_width="match_parent"
            android:layout_height="44dp"
            android:background="@null"
            android:hint="@string/Login_Email"
            android:textSize="14sp"
            android:inputType="textPersonName|textCapWords"
            android:padding="10dp"
            android:drawableStart="@drawable/ic_mail_outline_black_24dp"
            android:drawablePadding="10dp"/>

        </android.support.design.widget.TextInputLayout>

我的模拟器 API 是 19

请帮助我,我还是android编程的新手,谢谢

确保在您的 xml 中使用android.support.design.widget.TextInputEditText而不是纯TextInputEditText
编辑:检查 drwable 是否在 drawable 文件夹中而不是在drawable(v24)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM