fix(android:scalesPageToFit): scalesPageToFit does not work as intended , especially for large jpg and png images. (#275)

fixes #113

- One can verify that this for jpg images loaded on the webview (eg: https://www.ecda.gov.sg/growatbeanstalk/PublishingImages/READ%20Publications%20and%20Research/Parent%20Infographic%20Series/Infographic%204.jpg)
- This is a replication of the pull request that was originally made in the react-native repo (https://github.com/facebook/react-native/pull/17195), but was not merged in due to no reviews.
This commit is contained in:
Benjos Antony
2019-02-28 22:02:44 +01:00
committed by Thibault Malbranche
parent 0e6e92a7f1
commit a661df1ffc
@@ -562,7 +562,8 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
@ReactProp(name = "scalesPageToFit")
public void setScalesPageToFit(WebView view, boolean enabled) {
view.getSettings().setUseWideViewPort(!enabled);
view.getSettings().setLoadWithOverviewMode(enabled);
view.getSettings().setUseWideViewPort(enabled);
}
@ReactProp(name = "domStorageEnabled")