Skip to content

Instantly share code, notes, and snippets.

@SpiritOfDarkDragon
Created April 15, 2015 12:14
Show Gist options
  • Save SpiritOfDarkDragon/b32e38dcf85e24d73929 to your computer and use it in GitHub Desktop.
Save SpiritOfDarkDragon/b32e38dcf85e24d73929 to your computer and use it in GitHub Desktop.
Disabling auto-scroll scrollview, after data in webview is loaded
Adding the "descendantFocusability" attribute to the ScrollView's containing LinearLayout, with the value "blockDescendants". In my case:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:descendantFocusability="blocksDescendants" >
@imrankhanluhar
Copy link

right

@ShanmugavelGK
Copy link

correct.

@GibranPolonsky
Copy link

Awesome.

@MrAndrixx
Copy link

Thanks you!

@MrThiago
Copy link

You are Awesome. Big Thanks.

@MalikGhulamMurtza
Copy link

Saved my hours of R&D, excellent solution. Thanks,

@aolphn
Copy link

aolphn commented Aug 31, 2018

I found a similar issue,in same cases,webview will scroll slowly or auto scroll back when set View.LAYER_TYPE_SOFTWARE for webview like follow:
webview.setLayerType(View.LAYER_TYPE_SOFTWARE, null)

@sud007
Copy link

sud007 commented Sep 6, 2018

I used FrameLayout as the parent instead of LinearLayout. That worked!

@m-salcedo
Copy link

Great! Good job

@ZaccharieBOUVY
Copy link

nice !

@anandabayu
Copy link

anandabayu commented Jan 27, 2020

Thanks, this helps me so much

@MananHamza
Copy link

Good thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment