加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ReactNative Demo - Dimensions 的使用

发布时间:2020-12-15 03:27:13 所属栏目:百科 来源:网络整理
导读:import React,{ Component } from 'react' ; import { AppRegistry,StyleSheet,Text,View,Image,DrawerLayoutAndroid,ListView,PixelRatio,TextInput,Dimensions,} from 'react-native' ; class AwesomeProject extends Component { render() { return (View
import React,{
    Component
  } from 'react';
  import {
    AppRegistry,StyleSheet,Text,View,Image,DrawerLayoutAndroid,ListView,PixelRatio,TextInput,Dimensions,} from 'react-native';


  class AwesomeProject extends Component {


    render() {



      return (


<View style={styles.container}>
            <View style={styles.child} />
          </View>



      );


    }
  }



 class Search extends Component{

   render(){
      return(
        <View style={[styles.flex,styles.flexDirection]}>
          <View style={[styles.flex,styles.input]}>
          <TextInput></TextInput>
          </View>
          <View style={styles.btn}>
            <Text style={styles.search}>搜索</Text>
          </View>
        </View>
        );
    }
 }




  const styles = StyleSheet.create({
    flex: {
      flex:1,},flexDirection :{
      flexDirection:'row',topStatus : {
      marginTop : 25,input:{
      height:45,borderColor:'red',borderWidth: 1,marginLeft:10,borderRadius:5,paddingLeft:10,btn:{
      height:45,width:45,marginLeft:-5,marginRight:5,backgroundColor:'#23BEFF',alignItems:'center',justifyContent:'center',search:{
      color:'#fff',fontWeight:'bold',fontSize:15,container: {
      backgroundColor:'green',flex: 1,child: {
      flex: 1,backgroundColor: 'blue',transform: [
        {
          perspective: 850
        },{
          translateX: -Dimensions.get('window').width * 0.24
        },{
          rotateY: '60deg'
        },],}
  });



  AppRegistry.registerComponent('AwesomeProject',() => AwesomeProject);

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读