我想启用 ScrollView 并通过按钮单击禁用它。
禁用意味着如果 ScrollView 不存在,则启用它返回 ScrollView。
我希望这样,因为我有一个文字图像的画廊,在一个按钮上点击屏幕方向的变化,所以在横向的文字变得更大。我想要的滚动视图,以便图像不会拉伸本身和文字变得不可读。
scrollview.Enabled=false / setVisibility(false)
doesn't make anything.
Xml:
<ScrollView
android:id="@+id/QuranGalleryScrollView"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<Gallery android:id="@+id/Gallery"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="horizontal"></Gallery>
</ScrollView>
I can't use Visibility (gone) since that would also hide the Gallery, what I want is to hide the effect of the ScrollView. When there is ScrollView, the images in Gallery become scrollable and do not fit in the screen so you have to scroll to see the whole image. I don't want to disable/enable that on a button click.
我试过了:
((ScrollView)findViewById(R.id.QuranGalleryScrollView)).setOnTouchListener(null);
((ScrollView)findViewById(R.id.QuranGalleryScrollView)).setHorizontalScrollBarEnabled(false);
((ScrollView)findViewById(R.id.QuranGalleryScrollView)).setVerticalScrollBarEnabled(false);
((ScrollView)findViewById(R.id.QuranGalleryScrollView)).setEnabled(false);
但是画廊中的图像仍然是可滚动的,不适合屏幕。解决这个问题的办法是什么?