RN stylesheet calc问题
在RN中不同于常用的less/sass,有提供对应的calc计算属性,只能通过获取到宽高做JS计算。
以设置某个View宽度为例:
import { Dimensions, View } from 'react-native';
...
const screenWidth = Dimensions.get('window').width;
...
<View style={{ width: screenWidth - 100, backgroundColor: color.pageBg }}></View