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编程的新手,谢谢。
答案 0 :(得分:0)
请确保在您的xml中使用public function ajouter(Request $request){
$employe = new employe;
$employe->No_Employe = $request->input('No_Employe');
$employe->Nom = $request->input('Nom');
$employe->Prenom = $request->input('Prenom');
$employe->Email = $request->input('Email');
$employe->Adresse = $request->input('Adresse');
$employe->Date_Naissance = $request->input('Date_Naissance');
$employe->Titre_Emploi = $request->input('Titre_Emploi');
$employe->Telephone = $request->input('Telephone');
$employe->Annee_Embauche = $request->input('Annee_Embauche');
$employe->Present_Travail = $request->input('optTrav');
$employe->Sexe = $request->input('optSexe');
$employe->Fumeur = $request->input('optFum');
$employe->Langue = $request->input('Langue');
if (DB::table('liste_ville')->where('Nom_Ville','=',$request->input('Ville'))->get() != null)
{
$employe->Fk_Id_Ville = DB::table('liste_ville')->where('Nom_Ville','=',$request->input('Ville'))->value('Id_Ville');
}
else
{
$newVille = ucfirst($request->input('Ville'));
DB::table('liste_ville')->insertGetId(['Nom_Ville' => $newVille]);
$MoreVille = DB::table('liste_ville')->get();
foreach ($MoreVille as $key => $v)
{
if(strtolower($request->input('Ville')) === strtolower($v->Nom_Ville)){
$employe->Fk_Id_Ville = $v->Id_Ville;
break;
}
}
}
$employe->Code_Postal = $request->input('Code_Postal');
$employe->Actif = $request->input('optActif');
if (DB::table('provinces')->where('Nom_Province','=',$request->input('Province'))->get() != null) {
$employe->Fk_Id_Province =DB::table('provinces')->where('Nom_Province','=',$request->input('Province'))->value('Id_Province');
}
else
{
$newProv = ucfirst($request->input('Province'));
DB::table('provinces')->insertGetId(['Nom_Province' => $newProv]);
foreach ($provinces as $key => $p)
{
if(strtolower($request->input('Province')) === strtolower($p->Nom_Province)){
$employe->Fk_Id_Province = $p->Id_Province;
break;
}
}
}
$employe->save();
return redirect('/dossiers');
}
而不是普通的android.support.design.widget.TextInputEditText
编辑:检查drwable是否在drawable文件夹中,而不是说TextInputEditText