我有一个PopupWindow
,我用我的Activity
,一切工作正常,除了包含在PopupWindow
内的元素的填充 - 它太大了 - 从字面上占用了大部分的小PopupWindows空间。下面是我用来定义XML的PopupWindow
:PopupWindow填充 - 太大
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/homescreen_popup_bg_levels">
<TextView
android:id="@+id/x"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:textSize="12dp">
</TextView>
<TextView
android:id="@+id/y"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="12dp"
android:textColor="#FF000000">
</TextView>
</LinearLayout>
这里是PopupWindow
的截图:
任何想法,为什么文本正在被填补向下和向右这么多?我试过调整XML填充等,但没有运气。
嗯,你上面看到的图像是9补丁没有填充,只是在中间左侧,中间顶部的一个点来伸展。有四个图层(左上角,右上角,左下角,右下角的方向,并且所有图像在9补丁和没有填充框方面是相同的。也许我需要定义一个? –