AppWidget父布局比它需要的大

时间:2012-04-30 17:39:16

标签: android android-widget

出于某种原因,我的app小部件的父级比它应该的大。这导致用户无法以他们应该的方式向上移动图标。

我希望它是450x352,但AppWdigetHostView是608x390,父线性布局是584x366。

enter image description here

widget_large_info.xml

<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="294dp"
android:minHeight="72dp"
android:updatePeriodMillis="86400000"
android:initialLayout="@layout/widget_layout_large" />

widget_layout_large.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="0dip"
    android:background="#FF0000" >

<RelativeLayout
    android:layout_width="450dip"
    android:layout_height="352dip" >

    <!-- sub widgets and views -->

</RelativeLayout>
</LinearLayout>

有没有人见过这样的东西?无论我对宽度和高度做什么,它都不希望自己适当地调整尺寸。

0 个答案:

没有答案