只要編輯文本為空,應用程序就會不斷崩潰。當我輸入電子郵件時,它工作正常。我不知道我做錯了什么,我已經(jīng)嘗試更改高度值,在它為空時手動檢查,但問題仍然存在。任何人都可以讓我知道代碼是否有問題。XML:<android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent" android:focusableInTouchMode="true"> <android.support.design.widget.AppBarLayout android:id="@+id/appBarLayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:fitsSystemWindows="true" android:theme="@style/ThemeOverlay.AppCompat.ActionBar"> <android.support.design.widget.CollapsingToolbarLayout android:id="@+id/collapsingToolbarLayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:fitsSystemWindows="true" android:background="@color/colorBlackary" app:contentScrim="?attr/colorPrimary" app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed" app:titleEnabled="false"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="5dp" android:padding="10dp" android:text="@string/title_forgot_password" android:textColor="@color/colorRed" android:textSize="15sp" /> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_collapseMode="pin" app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> </android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.AppBarLayout>
2 回答

隔江千里
TA貢獻1906條經(jīng)驗 獲得超10個贊
我發(fā)現(xiàn)了問題:
android:theme="@style/TextLabel"
必須先創(chuàng)建一個主題,然后再創(chuàng)建一個樣式,然后像這樣使用它:
<style name="TextLabel" parent="BellicTheme">
謝謝大家
添加回答
舉報
0/150
提交
取消