So I have a universal app and I'm setting up the content size of a UIScrollView
. Obviously the content size is going to be different on iPhones and iPads. How can I set a certain size for iPads and another size for iPhones and iPod touches?
Open the Settings app to check your iOS information: Tap General. Tap About. It will show the device info, including the device name.
To determine if a device is iPhone or iPad with React Native, we can use the Platform. isPad property. If it's true , then it's an iPad. If it's false , it's an iPhone.
If want your iPhone and iPad to work smoothly together, you have to go through a couple of steps. Log in with the same Apple ID on both devices, connect the devices to the same WiFi network, turn on Bluetooth and Handoff. Handoff is easy to turn on. You go to 'Settings' and tap 'General' > 'Airplay and Handoff'.
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { // The device is an iPad running iOS 3.2 or later. } else { // The device is an iPhone or iPod touch. }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With