12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- /**
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @format
- * @flow
- */
-
- import React, {Component} from 'react';
- import {Text, View} from 'react-native';
-
- import WebView from 'react-native-webview';
-
- const HTML = `
- <!DOCTYPE html>\n
- <html>
- <head>
- <title>Hello World</title>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="width=320, user-scalable=no">
- <style type="text/css">
- body {
- margin: 0;
- padding: 0;
- font: 62.5% arial, sans-serif;
- background: #ccc;
- }
- h1 {
- padding: 45px;
- margin: 0;
- text-align: center;
- color: #33f;
- }
- </style>
- </head>
- <body>
- <h1>Hello World</h1>
- </body>
- </html>
- `;
-
- type Props = {};
- type State = {};
-
- export default class InlineWebView extends Component<Props, State> {
- state = {};
-
- render() {
- return (
- <View style={{ height: 120 }}>
- <WebView
- source={{html: HTML}}
- automaticallyAdjustContentInsets={false}
- />
- </View>
- );
- }
- }
|