我在 HorizontalScrollView 中有一个自定义视图,如下所示:
在MyCustomView的onDraw()方法中,我绘制了一些文本和位图。问题在于自定义视图的宽度变得比屏幕宽度更大,而水平滚动视图没有滚动,就好像它被禁用了。这是什么原因呢?
<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()方法中,我绘制了一些文本和位图。问题在于自定义视图的宽度变得比屏幕宽度更大,而水平滚动视图没有滚动,就好像它被禁用了。这是什么原因呢?