【问题标题】:React Native WebView status barReact Native WebView 状态栏
【发布时间】:2020-07-19 16:17:58
【问题描述】:

如何在 WebView 上解决这个问题?

react-webview-issue

我的代码:

import * as React from 'react';
import { WebView } from 'react-native-webview';

export default class App extends React.Component {
   render() {
      return <WebView source={{ uri: 'https://foo.co' }} style={{ marginTop: 50 }} />;
   }
} 

提前谢谢你!

【问题讨论】:

    标签: react-native webview statusbar


    【解决方案1】:

    这样做:

    import * as React from 'react';
    import { WebView } from 'react-native-webview';
    
    export default class App extends React.Component {
       render() {
          return <>
           <StatusBar hidden={true} />                  
           <WebView source={{ uri: 'https://foo.co' }} style=     {{marginTop: 50 }} />
           </>;
       }
    } 

    【讨论】:

    • 解决了!谢谢,我想添加一种颜色,但参数 BackgroundColor 不起作用。你有什么想法吗?
    • 是的,它有效..
    • 是的,已经完成了,但是 BackgroundColor 对我不起作用。没有变化。
    • 我的错字:因为 backgroundColor 道具仅适用于 Android,而 barStyle 道具仅适用于 iOS。
    猜你喜欢
    • 2019-03-02
    • 1970-01-01
    • 2019-06-18
    • 1970-01-01
    • 2022-10-14
    • 2017-10-10
    • 2018-07-05
    • 2016-07-11
    • 1970-01-01
    相关资源
    最近更新 更多