| /res/layout/activity_main.xml |
| <?xml version="1.0" encoding="utf-8"?> <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" android:layout_margin="5dp" tools:context=".MainActivity"> <android.support.design.widget.TextInputLayout android:id="@+id/main_iply_input" android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.design.widget.TextInputEditText android:id="@+id/main_edit_input" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="hint" /> </android.support.design.widget.TextInputLayout> <android.support.design.widget.TextInputLayout android:id="@+id/main_iply_output" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="8dp" app:layout_constraintBottom_toBottomOf="parent"> <android.support.design.widget.TextInputEditText android:id="@+id/main_edit_output" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="hint" /> </android.support.design.widget.TextInputLayout> </android.support.constraint.ConstraintLayout> |
當APP開啟時直接閃退,並拋出:
Caused by: android.view.InflateException: Binary XML file line #10: Binary XML file line #10: Error inflating class android.support.design.widget.TextInputLayout
解決方法
匯入com.android.support:design及com.android.support:appcompat-v7這兩個套件
沒有留言:
張貼留言