我试图做一个小部件,这将是4X1。 我设置的提供者遵循线性布局太大了Widget大小
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="294dp"
android:minHeight="72dp"
android:updatePeriodMillis="0"
android:initialLayout="@layout/widgetlayout"></appwidget-provider>
和部件布局如下
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="320dp"
android:layout_height="100dp"
android:background="@drawable/widgetframe">
<Button android:id="@+id/butscan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Click Me" />
<Button android:id="@+id/butenable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="On/Off"
android:paddingRight="5dip"/>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="4dip"
android:includeFontPadding="false"
android:id="@+id/lblcurrent"
android:text="Test"/></LinearLayout>
现在,当我尝试这在模拟器上,我得到的只是在主屏幕上显示的该层的中间。背景图像是来自SDK的4x1肖像图像(320x100)。
我在想什么?