React Native - View disappears when position is absolute on Android

前端 未结 6 1363
温柔的废话
温柔的废话 2021-02-14 08:04

Whenever I made the position style \'absolute\' for this view, it disappears. I have no idea why it is happening.

import React, { Component } from \'react\';
imp         


        
6条回答
  •  一向
    一向 (楼主)
    2021-02-14 08:34

    I cannot comment because of I don't have enough rep, However, additional to what Amir Khorsandi said, you can also use onLayout to see what value you are getting. This way you can see it in your remote console log, even the x and y of the said View. I hope it helps.

     {
                    var {x, y, width, height} = event.nativeEvent.layout; console.log(x, y, width, height)}}>
    

提交回复
热议问题