搜索框和导航栏(React Native)
by 伍雪颖
'use strict'; var React = require('react-native'); var { AppRegistry,StyleSheet,View,TextInput,} = React; class SearchBar extends React.Component { render() { return ( <View style={styles.searchRow}> <TextInput autoCapitalize="none" autoCorrect={false} clearButtonMode="always" placeholder="Please input your name..." style={styles.searchTextInput} /> </View> ); } } class SampleApp extends React.Component { render() { return ( <React.NavigatorIOS style={styles.container} initialRoute={{ title: 'My App',component: SearchBar,}}/> ); } } var styles = React.StyleSheet.create({ container: { flex: 1 },searchRow: { backgroundColor: '#eeeeee',paddingTop: 75,paddingLeft: 10,paddingRight: 10,paddingBottom: 10,},searchTextInput: { backgroundColor: 'white',borderColor: '#cccccc',borderRadius: 3,borderWidth: 1,height: 30,paddingLeft: 8,}); React.AppRegistry.registerComponent('SampleApp',function() { return SampleApp });
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。