![](/img/trans.png)
[英]Showing Elevation with Cardview in Preview in Android Studio but not in Device
[英]Android studio - TextView showing on preview but not emulator/device
您需要將tools:text
更改為android:text
。 使用tools屬性,您只能在設計時看到預覽。
使用LinearLayout和布局權重時,將文本和圖像的高度設置為0dp
如果您想使事物居中並相互對齊,則首選RelativeLayout或ConstraintLayout。
嘗試減輕布局重量,這可能是問題所在。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.