码迷,mamicode.com
首页 > 其他好文 > 详细

搜索框和导航栏(React Native)

时间:2015-04-04 01:18:40      阅读:885      评论:0      收藏:0      [点我收藏+]

标签:ios   react native   

搜索框和导航栏(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 });


搜索框和导航栏(React Native)

标签:ios   react native   

原文地址:http://blog.csdn.net/rainlesvio/article/details/44863381

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!