WebView: how to preserve the user's zoom settings across sessions?

前端 未结 3 672
我在风中等你
我在风中等你 2020-12-10 08:45

My app uses a WebView, and users sometimes adjust the zoom level to make the text larger. However the zoom level setting is lost when the Activity is closed and another one

3条回答
  •  甜味超标
    2020-12-10 09:34

    Perhaps you could try:

    http://d.android.com/reference/android/webkit/WebSettings.html#setDefaultZoom(android.webkit.WebSettings.ZoomDensity)

    &

    http://d.android.com/reference/android/webkit/WebSettings.html#getDefaultZoom()

    I haven't tried it myself but that looks like it might work

提交回复
热议问题