由于某些原因,当我在iOS上运行我的应用程序时,React Native会显示左右边框的下方(安卓很好)。正如你在第二张图片上看到的,徽标根本没有任何边框。
你知道它是从哪里来的吗?
export const Logo = styled.Image`
align-self: center;
`;
<Logo source={require('../../assets/logo.png')} style={{ width: 200, height: 200 }} />


发布于 2021-01-21 23:00:19
在安卓上可以添加elevation:0来解决,在IOS上可以添加shadowOffset: { height: 0, width: 0 }, shadowOpacity: 0, shadowRadius: 0来修复,如下所示:
export const Logo = styled.Image`
align-self: center;
`;
<Logo
source={require('../../assets/logo.png')}
style={{
width: 200,
height: 200,
elevation: 0,
shadowOffset: { height: 0, width: 0 },
shadowOpacity: 0,
shadowRadius: 0
}}
/>https://stackoverflow.com/questions/65829899
复制相似问题