iOS에는 상태 표시 줄 bg의 개념이 없습니다. 다음은 크로스 플랫폼 방식으로이를 줄 방법은 다음과 같습니다
1가)이 추가 :
import React, {
Component,
} from 'react';
import {
AppRegistry,
StyleSheet,
View,
StatusBar,
Platform,
} from 'react-native';
const MyStatusBar = ({backgroundColor, ...props}) => (
<View style={[styles.statusBar, { backgroundColor }]}>
<StatusBar translucent backgroundColor={backgroundColor} {...props} />
</View>
);
class DarkTheme extends Component {
render() {
return (
<View style={styles.container}>
<MyStatusBar backgroundColor="#5E8D48" barStyle="light-content" />
<View style={styles.appBar} />
<View style={styles.content} />
</View>
);
}
}
const STATUSBAR_HEIGHT = Platform.OS === 'ios' ? 20 : StatusBar.currentHeight;
const APPBAR_HEIGHT = Platform.OS === 'ios' ? 44 : 56;
const styles = StyleSheet.create({
container: {
flex: 1,
},
statusBar: {
height: STATUSBAR_HEIGHT,
},
appBar: {
backgroundColor:'#79B45D',
height: APPBAR_HEIGHT,
},
content: {
flex: 1,
backgroundColor: '#33373B',
},
});
AppRegistry.registerComponent('App',() => DarkTheme);
이 단추를 사용하여 작업 표시 줄을 갖는 소스 코드를 얻는 방법은 있습니까 (메뉴, 검색 등)? 감사합니다. – AlainIb
https://github.com/oblador/react-native-vector-icons에는 https://material.io/icons/에있는 Google 머티리얼 디자인 아이콘과 여기에서 탐색 할 수있는 많은 다른 아이콘이 포함되어 있습니다. https://oblador.github.io/react-native-vector-icons/ –