简体   繁体   English

如何在 React Native 中进行响应式设计

[英]How to make of responsive design in react native

Code代码

App.js应用程序.js

<View style={style.headr}>
    <TouchableOpacity
      onPress={() => navigation.goBack()}
    >
      <Image style={style.backimg} source={require("../img/back.png")} />
    </TouchableOpacity>
    <Text style={{ fontSize: 23, marginLeft: deviceWidth/5, color: '#fff' ,}}>Notification</Text>
</View>

css css

headr: {
    width: "100%",
    height: 100,
    backgroundColor: '#3C79F5',
    elevation: 2,
    alignItems: 'center',
    flexDirection: 'row',
    borderBottomRightRadius:50
},

here is img这是 img

在此处输入图像描述

I want Img 1 output but when i try to is look like Img2 output我想要 Img 1 output 但当我尝试时看起来像 Img2 output

how to do full responsiv output like img1如何像 img1 一样完全响应 output

For responsive height, width, margin, padding.. you can use this npm对于响应高度,宽度,边距,填充..你可以使用这个 npm

https://www.npmjs.com/package/react-native-responsive-screenhttps://www.npmjs.com/package/react-native-responsive-screen

For responsive font size, you can go with this npm对于响应式字体大小,您可以使用 go npm

https://www.npmjs.com/package/react-native-responsive-fontsize https://www.npmjs.com/package/react-native-responsive-fontsize

Regarding design issue you are facing, we can only inform after you put all code that you did关于您面临的设计问题,我们只能在您输入所有代码后通知您

As you added code for style of headr then it looks like borderBottomLeftRadius pending to curv from bottom left side same as right one to match expect result当您为headr样式添加代码时,它看起来像borderBottomLeftRadius从左下角挂起曲线与右下角相同以匹配预期结果

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM