相同宽度和高度的重叠组件
Overlapping components of same width and height
是否可以实现包含两个组件的 ReactNative 布局,其中第二个组件与第一个组件重叠并且具有相同的宽度,也可能具有相同的高度(当然没有硬编码 width/height)?在本机 Android 中很容易实现类似的东西,但我找不到 ReactNative 的示例。如果不可能,我会感到惊讶。
你可以试试下面的方法
<View style={{ flex: 1 }} >
<View style={{ flex: 1 }}>
// 1st component
<View>
<View style={StyleSheet.absolueFill}>
// 2st component
<View>
<View>
是否可以实现包含两个组件的 ReactNative 布局,其中第二个组件与第一个组件重叠并且具有相同的宽度,也可能具有相同的高度(当然没有硬编码 width/height)?在本机 Android 中很容易实现类似的东西,但我找不到 ReactNative 的示例。如果不可能,我会感到惊讶。
你可以试试下面的方法
<View style={{ flex: 1 }} >
<View style={{ flex: 1 }}>
// 1st component
<View>
<View style={StyleSheet.absolueFill}>
// 2st component
<View>
<View>