我希望第二个View
相对位于第一个View
的下方-50,但第二个View
不在底部完全延伸。
import React from 'react';
import {View, Text} from 'react-native';
export const OverlayStorybook = () => {
return (
<View style={{flex: 1}}>
<View style={{height: 100, backgroundColor: 'red'}}>
<Text>OverlayStorybook</Text>
</View>
<View style={{flex: 1, backgroundColor: 'blue', top: 0}} />
</View>
);
};
import React from 'react';
import {View, Text} from 'react-native';
export const OverlayStorybook = () => {
return (
<View style={{flex: 1}}>
<View style={{height: 100, backgroundColor: 'red'}}>
<Text>OverlayStorybook</Text>
</View>
<View style={{flex: 1, backgroundColor: 'blue', top: -50}} />
</View>
);
};
您可以在底部看到50个白色像素。