justifyContent和alignItems
来源:互联网 发布:无损音乐声谱软件 编辑:程序博客网 时间:2024/06/11 22:43
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, {Component} from ‘react’;
import {
AppRegistry,//注册
StyleSheet,//样式
Text,//文本组件
View,//视图组件
Image//图片组件
} from ‘react-native’;
//引入像素点库
var Dimension = require(‘Dimensions’);
export default class Test1 extends Component{
render() { return( <View style={mystyle.innerStyle}> <Text style={{backgroundColor:'red',height:30}}>中国1</Text> <Text style={{backgroundColor:'green',height:40}}>中国2</Text> <Text style={{backgroundColor:'yellow',height:50}}>中国3</Text> <Text style={{backgroundColor:'blue',height:60}}>中国4</Text> </View> );}
}
const mystyle = StyleSheet.create({
innerStyle:{
marginTop:50,
// flex:1,
backgroundColor:’#F5FCFF’,
//改变主轴方向
flexDirection:’row’,
//主轴内容的对齐方式
/*
* flex-start 对齐主轴的起点位置
* flex-end 对齐主轴的起点位置
* space-between 平均分配两端对齐
* space-around 平均分配
*
*
* */
justifyContent:’space-around’,
//设置侧轴 /* * flex-start 侧轴开始点 * flex-end 侧轴结束点 * center 居中 * space-around 平均分配 * */ alignItems:'center',
}
});
//注册Demo 输出到ios应用
AppRegistry.registerComponent(‘HelloWorld’, () => Test3);
- justifyContent和alignItems
- React Native flexbox的justifyContent、alignItems灵活应用
- React-native之flexDirection,justifyContent
- React Native flex布局alignItems、alignContent、alignSelf的区别
- . 和 ->
- || 和&&
- .和::
- “?”和“!”
- #和##
- && 和 ||
- 、和
- #和##
- .//和..//
- 和
- ?和\?
- ./ 和 ../
- #和##
- #、和##
- Android File简单操作
- 作业3
- Mybatis逆向生成工具——MyBatis Genertor
- Spring多线程批量发送邮件(ThreadPoolTaskExecutor)
- H5基础第三课时(3)
- justifyContent和alignItems
- 工厂模式
- 【Java】构造器
- ofbiz初级--安装与配置
- 周志华老师对于研究生入学的要求
- Linux(Ubuntu16.04)+GitLab8.17deb安装包搭建Git仓库(代码管理系统)
- 玩不转scikit-learn(一):LinearRegression
- tensorflow:embedding_lookup
- 位运算、移位运算符