react-native 實現微信頭部編寫
阿新 • • 發佈:2019-01-25
react-native 編寫微信頭部要點:
1、圖示佈局(左右居右、上下居中)
2、可以點選事件,點選時有個背景色
佈局實現
1、在react-native中無法使用float、display:inline-block
2、使用Flexbox(彈性盒子): flex, alignItems,justifyContent
本例通過Flexbox實現圖示佈局
header:{ height: height(150), backgroundColor: '#373a3f', paddingRight: width(70) }, headerTools: { flex:點選事件
點選事件實現需要使用TouchableHighlight控制元件
最終實現效果