React-native: Webview.scalesPageToFit not working on Android

Created on 17 Oct 2017  路  14Comments  路  Source: facebook/react-native

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: macOS Sierra 10.12.6
Node: 6.11.0
Yarn: 1.0.1
npm: 4.6.1
Watchman: 4.7.0
Xcode: Xcode 9.0 Build version 9A235
Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
react: 16.0.0-alpha.12 => 16.0.0-alpha.12
react-native: 0.48.3 => 0.48.3

Steps to Reproduce

  1. Create a component ON ANDROID, with scalesPageToFit set to true, and a source of some website:
    <WebView scalesPageToFit source={{ https://github.com/facebook/react-native/issues/new" }} />

    Expected Behavior

The screen loads with the website filling the viewport.

Actual Behavior

The screen load with the image extending beyond the viewport

image

Stale

Most helpful comment

Yes, this is a serious issue. The same site I'm trying to load in my WebView scales just fine in iOS. Worse, I can't even horizontally scroll. Please reopen.

All 14 comments

solution?

Have you solved it

While scalesPageToFit does work for me with GitHub.com on Android, other sites don't scale nicely at all. (Just like above)

I have submitted #17583 which fixes this problem for me.

+1

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

The bug is still here. Any updates?

Yes, this is a serious issue. The same site I'm trying to load in my WebView scales just fine in iOS. Worse, I can't even horizontally scroll. Please reopen.

@iDay can you give an example using this library?

https://github.com/yptech/react-native-yunpeng-webview

@smitthakkar1
use it just like react-native's

@iDay Thanks man, works great! Maybe can you submit another PR with the fix to RN? Because #17195 was closed without merging :(

up

up,
a lot of version passed, but this patch https://github.com/tranvinhtruong/react-native/commit/01f02a596a2575b84dac1901703b6216c5e630c5 still not applied :(

is this fixed yet?

Was this page helpful?
0 / 5 - 0 ratings