【发布时间】:2011-10-12 10:17:41
【问题描述】:
我为自定义 toast 消息创建了布局,并将 fill_parent 设置为自定义布局的根元素,但布局的大小仍然比整个屏幕小很多。
是否可以设置toast消息的大小占据整个屏幕?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toast_layout_root"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" android:gravity="center" >
<ImageView android:id="@+id/image"
android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_margin="10dip"/>
</LinearLayout>
注意 android:layout_width="fill_parent" 和 android:layout_height="fill_parent" 属性。但我的布局仍然是屏幕的三分之一左右。 . .
任何想法或建议如何让我吐司占据整个屏幕?
【问题讨论】:
标签: android layout android-layout customization toast