📅  最后修改于: 2022-03-11 14:48:13.792000             🧑  作者: Mango
// In my case I was using an android library that was
// not available in ios (StatusBar.currentHeight).
// I had to adapt my code:
const theView = styled.View`
margin-top:${StatusBar.currentHeight}
`;
// to:
const theView = styled.View`
${StatusBar.currentHeight && `margin-top:${StatusBar.currentHeight}px`};
`;