So, I have a DialogFragment, which I create when I click a button, used to select some information.
It seems that no matter what I do, if I use weightSum, the diaglog will fill the screen, even if I set layoutMargin or the width of the parent layout.
This is on the Galaxy 3.2 tab and uses the default Fragment library, not compatibility.
Any suggestions would be helpful.
thank
Below is the layout I am using.
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayoutZoneDialog"
android:layout_width="400dp"
android:layout_height="300dp"
android:layout_gravity="center"
android:background="@drawable/modal_background"
android:orientation="horizontal"
android:padding="20dp"
android:weightSum="1" >
<ListView
android:id="@+id/zoneSelectListView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".25"
android:divider="@color/trans"
android:listSelector="@android:color/transparent"
android:padding="25dp"
android:scrollbars="vertical"
android:scrollbarFadeDuration="0" >
</ListView>
<RelativeLayout
android:id="@+id/zoneSelectImageLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".75"
android:gravity="center">
<ImageView
android:id="@+id/zoneSelectMainImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/black_50_percent"
android:scaleType="fitCenter" />
<ImageView
android:id="@+id/zoneSelectCloseImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:src="@drawable/modal_close"
android:padding="15dp" />
</RelativeLayout>
</LinearLayout>
source
share