windowIsFloating
虽然是一种非常方便的创建Dialog
样式UI的工具,但它有许多奇怪的问题。
我正在遭遇的一个问题是,它将顶级祖先的宽度/高度分配为"wrap_content"
而不是屏幕的宽度/高度。这意味着通常使用"match_parent"
进行UI设计的方式会向上传播成为"wrap_content"
。真是糟糕的时刻。
所以,我真正想要的是创建一个活动,并拥有如下布局:
<LinearLayout android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical"
android:id="@+id/containerPageConatiner"
android:background="@drawable/windowBackground">
<View android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<FrameLayout android:id="@+id/singlePane"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_gravity="center_horizontal|center_vertical"
android:padding="10dp"/>
<View android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
</LinearLayout>
它会生成一个UI,显示在调用它的Activity上方的单个窗口(@id/singlePane)。
有人拥有创建透明背景Activity所需的完美样式集吗?