'use strict'; import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, PixelRatio, View, } from 'react-native'; class luumans extends Component { render(){ return ( <View style={styles.flexs}> <View style={styles.container}> <View style = {[styles.item,styles.center]}><Text style={styles.title}>酒店</Text> </View> <View style = {[styles.item,styles.lineLeftRight]}> <View style={[styles.flexs,styles.center,styles.lineCenter]}><Text style={styles.title}>海外酒店</Text></View> <View style={[styles.flexs,styles.center]}><Text style={styles.title}>特色酒店</Text></View> </View> <View style = {styles.item}> <View style={[styles.flexs,styles.center,styles.lineCenter]}><Text style={styles.title}>团购</Text></View> <View style={[styles.flexs,styles.center]}><Text style={styles.title}>客栈、公寓</Text></View> </View> </View> </View> ) } } const styles = StyleSheet.create({ container:{ flexDirection: 'row', height: 80, borderRadius: 5, marginTop: 200, marginLeft: 5, marginRight: 5, backgroundColor: '#FF0067', }, item:{ flex: 1, height: 80, }, title:{ fontSize: 16, fontWeight: 'bold', color: '#FFF', }, center:{ justifyContent: 'center', alignItems: 'center', }, flexs:{ flex: 1, }, lineCenter: { borderBottomWidth: 1/PixelRatio.get(), borderColor: '#FFF', }, lineLeftRight: { borderLeftWidth: 1/PixelRatio.get(), borderRightWidth: 1/PixelRatio.get(), borderColor: '#FFF', }, }); AppRegistry.registerComponent('luumans', () => luumans);
|