react-native style寫法

react-native如果需要結合單個的屬性寫法

            <Animated.Text style={[styles.newBgViewLabel,{display:this.showNEWView}]}>NEW</Animated.Text>

其中的newBgViewLabel是常見的定義

StyleSheet.create({

	container: {
	    flex: 1,
	    paddingTop: HeaderPadding,
	    backgroundColor: '#ffffff',
	},
	popbuttonContainer: {
		display:'flex',
		width:50,
		height:50,
		position:'absolute',
		right:10,
		bottom:60,
		backgroundColor:'purple'
	},
	swiperConainer:{
		display:'flex',
		flexDirection:'column',
		justifyContent:'center',
		alignItems:'center',
		width:50,
		height:50,
	},
	newBgView:{
		width:50,
		height:15,
		backgroundColor:'red',
		color:'white',
		fontSize:30,
		textAlign:'center',
	},
	newBgViewLabel:{
		position:'absolute',
		left:0,
		top:0,
		zIndex:100,
		width:'100%',
		height:15,
		backgroundColor:'red',
		color:'white',
		textAlign:'center',
	},
	)};
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章