Skip to content

Instantly share code, notes, and snippets.

@SpiritOfDarkDragon
Created April 15, 2015 12:14
Show Gist options
  • Select an option

  • Save SpiritOfDarkDragon/b32e38dcf85e24d73929 to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

right

@ShanmugavelGK

Copy link
Copy Markdown

correct.

@GibranPolonsky

Copy link
Copy Markdown

Awesome.

@MrAndrixx

Copy link
Copy Markdown

Thanks you!

@MrThiago

Copy link
Copy Markdown

You are Awesome. Big Thanks.

@MalikGhulamMurtza

Copy link
Copy Markdown

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

@aolphn

aolphn commented Aug 31, 2018

Copy link
Copy Markdown

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

sud007 commented Sep 6, 2018

Copy link
Copy Markdown

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

@m-salcedo

Copy link
Copy Markdown

Great! Good job

@ZaccharieBOUVY

Copy link
Copy Markdown

nice !

@anandabayu

anandabayu commented Jan 27, 2020 •

Copy link
Copy Markdown

Thanks, this helps me so much

@MananHamza

Copy link
Copy Markdown

Good thank you

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