React Native 0.60.5中的ZIndex问题

时间:2019-09-20 10:05:37

标签: react-native animation view

我正在使用React Native 0.60.5中的z-index问题,这是目前的最新版本。我希望红色框与蓝色框重叠。

我尝试过:

  
      
  1. z-index:红色框为1,蓝色框为-1。
  2.   
  3. z-索引:红色框为1000,蓝色框为-1000。
  4.   
  5. 红色框没有z-index,蓝色框没有-1。
  6.   

以上都不是

情况1:


 < View
 style = {
  {
   zIndex: 1,
   height: 100,
   width: 100,
   backgroundColor: 'red',
  }
 }
 /> <
 View
 style = {
  {
   height: 100,
   width: 100,
   zIndex: -1,
   backgroundColor: 'blue',
   position: 'absolute',
  }
 }
 />

情况2:

 < View
 style = {
  {
   zIndex: 1000,
   height: 100,
   width: 100,
   backgroundColor: 'red',
  }
 }
 /> <
 View
 style = {
  {
   height: 100,
   width: 100,
   zIndex: -1000,
   backgroundColor: 'blue',
   position: 'absolute',
  }
 }
 />

情况3:

 < View
 style = {
  {
   height: 100,
   width: 100,
   backgroundColor: 'red',
  }
 }
 /> <
 View
 style = {
  {
   height: 100,
   width: 100,
   zIndex: -1,
   backgroundColor: 'blue',
   position: 'absolute',
  }
 }
 />

Here is my app screen

1 个答案:

答案 0 :(得分:0)

 View
 style = {
  {
   height: 100,
   width: 100,
   zIndex: -1000,
   backgroundColor: 'blue',
   position: 'absolute',
   top : 10,
   left : 0
  }
 }
 />