W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
保留所有版權(quán)。
源代碼是在 BSD-style 許可下經(jīng)過許可的,是在源代碼樹的根目錄下的LICENSE 文件里找到的。額外授予的專利權(quán)可以在同目錄下的 PATENTS 文件里找到。
@flow
static setStyle(style: number, animated?: boolean)
static setHidden(hidden: boolean, animation: number)
'use strict'; var React = require('react-native'); var { StyleSheet, View, Text, TouchableHighlight, StatusBarIOS, } = React; exports.framework = 'React'; exports.title = 'StatusBarIOS'; exports.description = 'Module for controlling iOS status bar'; exports.examples = [{ title: 'Status Bar Style', render() { return ( <View> {Object.keys(StatusBarIOS.Style).map((key) => <TouchableHighlight style={styles.wrapper} onPress={() => StatusBarIOS.setStyle(StatusBarIOS.Style[key])}> <View style={styles.button}> <Text>setStyle(StatusBarIOS.Style.{key})</Text> </View> </TouchableHighlight> )} </View> ); }, }, { title: 'Status Bar Style Animated', render() { return ( <View> {Object.keys(StatusBarIOS.Style).map((key) => <TouchableHighlight style={styles.wrapper} onPress={() => StatusBarIOS.setStyle(StatusBarIOS.Style[key], true)}> <View style={styles.button}> <Text>setStyle(StatusBarIOS.Style.{key}, true)</Text> </View> </TouchableHighlight> )} </View> ); }, }, { title: 'Status Bar Hidden', render() { return ( <View> {Object.keys(StatusBarIOS.Animation).map((key) => <View> <TouchableHighlight style={styles.wrapper} onPress={() => StatusBarIOS.setHidden(true, StatusBarIOS.Animation[key])}> <View style={styles.button}> <Text>setHidden(true, StatusBarIOS.Animation.{key})</Text> </View> </TouchableHighlight> <TouchableHighlight style={styles.wrapper} onPress={() => StatusBarIOS.setHidden(false, StatusBarIOS.Animation[key])}> <View style={styles.button}> <Text>setHidden(false, StatusBarIOS.Animation.{key})</Text> </View> </TouchableHighlight> </View> )} </View> ); }, }]; var styles = StyleSheet.create({ wrapper: { borderRadius: 5, marginBottom: 5, }, button: { backgroundColor: '#eeeeee', padding: 10, }, });
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: