亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

屏幕旋轉期間 textview 背景顏色丟失

屏幕旋轉期間 textview 背景顏色丟失

一只斗牛犬 2023-03-09 11:30:46
我正在嘗試修復這個名為 mizuu 的應用程序中的錯誤,有一個用于選定演員的電影和電視節目的水平卡片布局,布局的右上角有一個顯示更多內容的按鈕,它有一個灰色背景顏色但是當旋轉方向到橫向模式時,反之亦然,“查看更多”文本的背景顏色丟失,有沒有辦法解決這個問題?文件actor_details.xmlhorizon ntal_grid_items.xmlHorizontalCardLayout.java https://pastebin.com/s6uPkBht<LinearLayout            android:layout_width="match_parent"            android:layout_height="match_parent"            android:background="@drawable/abc_list_selector_disabled_holo_dark"            android:orientation="vertical"            android:paddingLeft="@dimen/content_details_baseline_margin"            android:paddingRight="@dimen/content_details_baseline_margin"            android:paddingBottom="@dimen/content_details_baseline_margin">            <com.miz.views.HorizontalCardLayout                android:id="@+id/actor_movie_cards"                android:layout_width="match_parent"                android:layout_height="match_parent"                android:layout_marginTop="@dimen/details_medium_padding" />            <com.miz.views.HorizontalCardLayout                android:id="@+id/actor_tv_cards"                android:layout_width="match_parent"                android:layout_height="match_parent"                android:layout_marginTop="@dimen/details_medium_padding" />            <com.miz.views.HorizontalCardLayout                android:id="@+id/actor_photo_cards"                android:layout_width="match_parent"                android:layout_height="match_parent"                android:layout_marginTop="@dimen/details_medium_padding" />            <com.miz.views.HorizontalCardLayout                android:id="@+id/actor_tagged_photo_cards"                android:layout_width="match_parent"                android:layout_height="match_parent"                android:layout_marginTop="@dimen/details_medium_padding" />        </LinearLayout> 
查看完整描述

1 回答

?
九州編程

TA貢獻1785條經驗 獲得超4個贊

我認為這個問題的發生是因為你的活動中的代碼以某種方式使這個視圖消失了,我建議在 AndroidManifest 中設置 configChanges 方向。

 <activity
           ...
           android:configChanges="orientation|screenSize|keyboardHidden|smallestScreenSize|screenLayout"

https://developer.android.com/guide/topics/resources/runtime-changes


查看完整回答
反對 回復 2023-03-09
  • 1 回答
  • 0 關注
  • 99 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號