IPad simulator's screen resolution - ios

I designed my first ipad app.
And when i run it on the simulator resolution is really small. Smaller than really ipad's resolution. Right now i have not ipad, and cant test app on it.
What the problem with resolution?
UPD I connect big display to my macbook. But resolution is still small. I think thats because macbook's display is primary and big monitor is the second. How can i change it?

The problem is that the physical resolution of your screen is lower than the physical resolution of the iPad’s screen. For example my iMac’s screen has 1920 pixels per ~19 inches of width, or roughly 100 pixels per inch. The iPad’s screen density is about 130 ppi, one third higher. If you’re serious about your app, you have to test on the real device anyway. (By the way, if you are simply talking about the window size, that can be changed in the Window menu or using ⌘1–⌘3 shortcuts.)

Related

Why does Google Chrome emulator show iPhone 6 at 375x667 resolution?

I'm trying to programmatically adapt my website's image sizes for differently sized devices. But now I am having trouble telling what sizes I actually need. In Google Chrome emulator, I'm seeing some of my images upsized, e.g. on iPhone 6 from 230x230 natural to 357x357 displayed. The image takes up nearly the entire width of the emulated screen, and looks just slightly degraded, suggesting iPhone 6's width isn't much larger than 357 pixels.
But Apple says the iPhone 6 has a resolution of 750x1334! If that were true, the image should look much worse, I would think.
I've found some contradictory information on iPhone 4 as well.
This site talks about iPhone 4 at 640x960 pixels. Chrome emulator again shows it at half those dimensions, 320x480.
This stackoverflow question says that "the iPhone screen is 320x480 definitely."
What am I missing here? Why do some sources (including Apple) supply dimensions that are twice what Chrome emulator (and my images) say?
Relax, you're about to understand this mess. Just notice that 2 * 375x667 = 750x1334.
A pixel is not a pixel
The key thing is: one device pixel is different from one CSS pixel.
They are the same in low pixel density devices like your computer screen (96 dpi). However, high pixel density devices like smartphones and printers (upwards of 160 dpi) try to obey the general W3C CSS3 spec understanding that one CSS pixel should always be close to 1/96th of an inch (or 0.26 mm) when viewed from usual distance (arm's length).
They don't obey the spec to the letter, since that would imply 1px being exactly 1/96th of one real inch in high DPI settings, which wasn't ever implemented in any browser AFAIK. However, they try to make their CSS pixels not so minuscule despite very high pixel densities by making one CSS pixel equal to two or more device pixels.
Chrome Device Mode works with CSS pixels, which is what you should use to design text, navbars, headings etc, but not high-resolution images. For these, read the next section.
If you didn't notice, the image above shows that Chrome Device Mode does show you the device scale (how many device pixels equal one CSS pixel).
Fixing image resolution
As you already know, this affects images negatively, since the browser scales the image as well. Your 230x230 CSS pixels picture becomes 460x460 device pixels, using the same quality. To fix that, use the srcset attribute to give the browser links to different resolution files of the same image.
Example (adapted from the link above):
<img src="wolf-400.jpg" srcset="wolf-400.jpg 400w, wolf-800.jpg 800w, wolf-1600.jpg 1600w">
An iPhone 6 will look at that and think "oh, I pretend to be 375px wide but I'm actually 750px, so I'll download wolf-800.jpg."
Just don't forget to use src="" for compatibility. Also, unless you use sizes="", the browser will default to the full width of the device.

How to set screen resolution in IOS 7?

I build and run my old iPad app for IOS 7.
The screen resolution is twice as it was.
I don't want to re write the code to position the controls
There is no storyboard. Everything is in code
Can I have the same resolution in IOS 7 as it was before?
The screen coordinates are still the same, the coordinates are in floating point.
The screen resolution is 2048 x 1536 but if you get the CGRect frame for the entire screen it is is still 1024x768, as GGRect is floating point.
I don't really understand your problem. You shouldn't have any issue with de position of all element because there is no change in the coordinate system.
The thing you need to do is design image with retina size. For exemple if you had an image 2x2 you need the same image with the same proportion but in 4x4.
It sounds like you might be running an iPhone app on the iPad. On the new iPads the iPhone Apps run in 2x mode automatically on iOS 7 using the retina assets.

iOS frame and dimensions

I've searched a lot but find nothing about frame and dimension. I thought this should be a big topic.
Anyway, when create a view using frame, the whole screen size is 320*460 (320*480), but the dimensions of screen is 720*960. Can someone explain this? How to convert them.
This is only for 3.5 inch non-retina device.
EDIT:
I figured it out. The problem is because the size of iPad and iPhone is different. For iPhone, the dimension is 4:3, but for iPad, the dimension is 1.33.
Check out:
http://www.idev101.com/code/User_Interface/sizes.html
Points are how the screen is measured by apps so if you place something at a position you place it at a point. There are two pixels per point on retina devices.
This is only for 3.5 inch non-retina device.
No, this is the point. 3.5 inch retina devices have a resolution of 640*960.
For development Apple convert this resolution to the old 320*480 dimensions. Why ? To develop the same way for retina and non-retina devices. Except that you have to provide retina image. For a classic 100x100 image named myImage.png you have to provide a 200x200 image named myImage#2x.png. But all the development except that is the same. There are 4 times more pixels per point (ppp) on retina devices than on old iOS devices but it's transparent for the developers.
For the 320*480 vs 320*460 point : this is the status bar. In iOS < 7.0 status bar took 20 pixels height. You always should trust the [UIScreen mainScreen].applicationFrame.size to get the application size within the phone.
Update : you talk about uiimagepickercontroller don't mistake pictures taken from the camera (or from the web) with the screen resolution !

Force iPad retina simulator to fit on MacBook Air Screen

On my MB Air the iPad (retina) simulator, even at it's smallest size (50% scale) does not fit on the screen, requiring awkard scrolling. Does anyone know of a property that can be edited or something to make it even smaller than 50%?
You can use the cmd key modifiers to change the size:
Cmd+1 - original
Cmd+2 - smaller
Cmd+3 - smallest (this works best for me on my Macbook Air 11)
Unfortunately not, from what I've found. This link from a similar question explains,
it seems reasonable for the accurate rendering profiling that it maintains 1-to-1 pixel ratio, otherwise it would have to sub-sample the pixels, causing the profiling to be incorrect.
I use a 13" MB, so I understand that it's difficult to fit the iPad simulator on the screen.

Scene seems to display four times larger when running simulator with retina dispay

I am testing my app in the iphone simulator To test the retina display, I've set the hardware to iphone(retina)
Unfortunately, the entire scene seems to be scaled to four times its normal size!
The only thing I see, is the left bottom quarter of the entire scene.
The app, since it exceeds the bounds of the screen, shows up only as a quarter on the iphone screen.
I am using Cocos2d. What is the cause of this? I also have retina display enabled in the app delegate. Any help is greatly appreciated!
The simulator is increasing to four times it's normal size (twice on each axis) because by default it uses a 1:1 mapping of pixels.
In other words, one screen pixel = one device pixel. So when you go to Retina display, which doubles the retina density, you need four times as much space to display the device screen.
Edit:
In response to the updated question, you can use the 'scale' feature. Window->scale->50% (or command+3).

Resources