【问题标题】:How to open an website inside the react-native app(Android and iOS)如何在 react-native 应用程序中打开网站(Android 和 iOS)
【发布时间】:2019-10-24 05:05:23
【问题描述】:

我需要在我的 react-native 应用程序中打开网站。需要同时适用于 iOS 和 Android

【问题讨论】:

  • 您需要在屏幕内部打开它还是可以在外部网络浏览器内部打开它?
  • 你可以使用 react-native -webview
  • @KirillKunst 我需要在我的屏幕内部打开我需要设计该屏幕的页眉和页脚部分

标签: android ios react-native


【解决方案1】:

您可以使用WebView 组件:https://facebook.github.io/react-native/docs/webview.html

类似这样的:

import React, { Component } from 'react';
import { WebView } from 'react-native';
class MyWebViewComponent extends Component {
  render() {
     return (
      <WebView
         source={{uri: 'https://google.com'}}
         style={{marginTop: 10}}
      />
    );
  }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-05-17
    • 1970-01-01
    • 2018-11-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多