在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',
},
)};