[React Native] Target both iPhone and iPad with React Native

本文介绍如何使用 React Native 开发同时支持 iPhone 和 iPad 的通用应用。默认情况下,React Native 仅针对 iPhone 进行优化,要在 iPad 上运行并显示为原生应用,需要将 Xcode 项目设置为构建通用应用。具体操作包括更改部署信息中的设备类型从 iPhone 到通用,并调整样式以适应不同设备。

By default, React Native only targets iPhone - so if you run on an iPad, it will show up as a scaled app, and won't look like a native iPad app.

To target both iPhone and iPad, you have to change the xcode project to build it as a universal app. Do that by finding the Deployment Info section of the General tab in the app target - and switch that from iPhone to Universal.

Then, you can run your app in either the iPhone or iPad simulator, and change the styling based on the current device.

 

https://egghead.io/lessons/react-native-target-both-iphone-and-ipad-with-react-native

转载于:https://www.cnblogs.com/Answer1215/p/8987412.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值