Skip to content

yeong0809/react-native-autoreheight-webview

 
 

Repository files navigation

Version License

react-native-autoreheight-webview

An auto resize content height webview for React Native.
Pure JavaScript,and easy to use.
(rn >= 0.44)

install

yarn add react-native-autoreheight-webview

or

npm install react-native-autoreheight-webview

Demo1

showtime1

see more in Example.js

Demo2

showtime1

see more in Example2.js

Basic Usage

<AutoResizeHeightWebView
                defaultHeight={200}
                style={{backgroundColor:'white',width:300}}
                AnimationDuration={500} 
                source={{uri: 'http://www.ftchinese.com/story/001075607'}}/> 

Props

props name default desciption
defaultHeight 100 default Height
style {} webviewStyle
needAutoResetHeight true you can reset Height manually
AnimationDuration 500 animation duration
source null just like ReactNative's Webview
needAnimate true show animate or not when resetting height

And all props in React Native's WebView Component

Functions

function name desciption
resetHeight reset height to show all manually
resetSmallHeight reset Height to default height manually

If it helps you,please give it a star!

Feel free to add issues or feature requests

About

An auto resize content height webview for React Native.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 70.0%
  • Objective-C 17.5%
  • Python 6.9%
  • Java 5.6%