Android RelativeLayout wrap_content 而且 child view 使用 layout_alignParentBottom 時 RelativeLayout 高度會占滿屏幕


Android RelativeLayout wrap_content 而且 child view 使用 layout_alignParentBottom 時 RelativeLayout 高度會占滿屏幕,因為這兩個屬性互相沖突以致 RelativeLayout 無法確定自己的尺寸。邏輯性自己想想就明白了。

解決辦法是換用 FrameLayout,然后 child view 使用 android:layout_gravity="bottom"。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM