I would like to enable ScrollView and disable it with the click of a button.
Disable means that if ScrollView was not there .. and enable it returns ScrollView.
I want this because I have a gallery with text images, and when I click the button, the screen orientation changes, so the text becomes larger in landscape orientation. And I want ScrollView so that the image does not stretch and the text becomes unreadable.
scrollview.Enabled=false/setVisibility(false) does nothing.
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>
thank
Edit1: I cannot use the visibility (left), since this would also hide the gallery that I want to hide the ScrollView effect. When there is a ScrollView, the images in the Gallery become scrollable and do not fit on the screen, so you need to scroll to see the whole image, I do not want to turn it off / on at the click of a button.
I tried this:
((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);
Nevertheless, the images in the Gallery scroll and do not fit on the screen. What is the solution?
android android-scrollview
Omar Apr 23 2018-11-11T00: 00Z
source share