如何使WebView在react-native-webview中可滚动?

问题描述

我使用<WebView>时,<Card.Content>已嵌入react-native-paper中。我正在尝试使WebView可滚动。 Web视图显示但不可滚动。

我正在使用的代码:

  <Card theme={{ roundness: 20 }} style={{ margin: 10,height: height*0.8 }} elevation={14}>
     <Card.Content style={{ flex: 1 }}>
        <View style={{ justifyContent: "center",alignItems: "center" }}>
              <WebView
              style={{ width: width * 0.8,height: height * 0.9 }}
              allowsBackForwardNavigationGestures={false}
              source={{ uri: "https://paypal.com"}}
              pullToRefreshEnabled={false}
              javaScriptEnabled
              startInLoadingState
              decelerationRate="normal"
              scalesPageToFit={Platform.OS == "android"?  false : true}
              originWhitelist={['*']}
              domStorageEnabled={true}
              scrollEnabled
              renderError={e => { console.log(e); }}
              />
        </View>
     </Card.Content>
  </Card>

如何使WebView滚动?

解决方法

我想您可以尝试将CREATE FUNCTION [dbo].[GetSegmentId] ( @Planningid INT,@agencyID int ) RETURNS @tablevar TABLE ( id INT ) AS BEGIN declare @CachedRoute geography DECLARE @finalresult int DECLARE @result TABLE (id INT,starting sys.geography,ending sys.geography,chachedroute sys.geography) set @CachedRoute = (select CachedRoute from route where id = @Planningid) insert into @result select id,starting,Ending,CachedRoute from Route R where AgencyId=@agencyID and LayerId=1 and CachedRoute.STDistance(@CachedRoute)<0.5 insert into @tablevar select id from @result where @CachedRoute.STDistance(starting)<700 and @CachedRoute.STDistance(ending)<700 intersect select id from @result RETURN; END; 包裹在WebView中,如下所示:

ScrollView

此外,您可以使用react-native-autoheight-webview

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...