如何在不设置绝对宽度的情况下使子视图比其父视图宽?

时间:2011-08-14 22:30:54

标签: android android-layout

我正在尝试创建一个选框样式动画视图,其中非常宽的线性布局在较窄的视图中水平滚动。像

这样的东西
<LinearLayout
        android:id="@+id/ContentLinearLayout"
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_height="fill_parent"
        android:layout_width="fill_parent"
        android:clipChildren="false">

    <LinearLayout ...> <- a very wide layout that animates. 

</LinearLayout>

问题是我无法弄清楚如何使用其中的内容制作视图而不将其宽度剪切为其父级的大小而不设置精确的layout_width。动画内容视图是动态创建的,所以我不知道提前的宽度。这是一个appwidget所以我受到RemoteViews限制的进一步限制。

1 个答案:

答案 0 :(得分:0)

使用RemoteView,您必须指定固定宽度。

相关问题