Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

if (device == iPad), if (device == iPhone)

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?

like image 729
Peter Kazazes Avatar asked Aug 12 '11 21:08

Peter Kazazes


People also ask

How do I know if my phone is an iPad?

Open the Settings app to check your iOS information: Tap General. Tap About. It will show the device info, including the device name.

How do I know if my device is iPad or iPhone in react native?

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.

Can you use iPhone and iPad together?

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'.


1 Answers

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. } 
like image 73
Peter Kazazes Avatar answered Oct 13 '22 00:10

Peter Kazazes