【发布时间】:2012-03-10 15:48:42
【问题描述】:
我在 HorizontalScrollView 中有一个自定义视图,如下所示:
<HorizontalScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
>
<com.mina.demo.customwidgets.MyCustomView
android:layout_width="wrap_content"
android:layout_height="50dp"
/>
</HorizontalScrollView>
在 MyCustomView onDraw() 方法中,我绘制了一些文本和位图。
问题是自定义视图的宽度变得大于屏幕宽度,并且环绕水平滚动视图不会像禁用一样滚动。
这可能是什么原因?
【问题讨论】:
-
您可以尝试将自定义视图的宽度更改为 fill_parent 并查看它是否有所改变。
标签: android android-layout android-widget