Sorry if this is a silly question, just wondering if this is possible? I have a PDF I need to show, and I'm using a WebView to display it. It doesn't seem to want to render within
@robputer Do you have a screenshot of the error? Try using the webview inside a <View /> and see if that works.
+1
Started using WebView and if I use Container-> Content it will not render, If I replace the Container and Content with the View it will render.
Related to https://github.com/facebook/react-native/issues/4773
Please specify a height for the <WebView /> component.
Hello,
I'm opening this since I want to add a WebView inside the Content and it is not displaying. If I set the height it will, but I want it full page.
Set the height to deviceheight
And then it will display over the menu / footer .. so it's not good
Minus the height of header and footer. Because that is the way react native scrollview works and native-base is just a wrapper around it.
@grohsfabian @sankhadeeproy007 I think setting the height using deviceHeight isn't a good idea. We can achieve the same thing using flex. Instead of
It just doesn't work. I've tried to set it with { flex: 1 } but It won't show.
Any update on this?
I have encountered the same problem and solved it as below.
render () {
return (
<Container>
<Content contentContainerStyle={{ flex: 1 }}>
<WebView source={{ uri: 'something' }} />
</Content>
</Container>
);
}
Thank you horiuchie!
@horiuchie In that case the Content is unscrollable :(
Most helpful comment
I have encountered the same problem and solved it as below.