iOS - constraints and verify for traits - swift

So i am trying to do 2 types of constraints.
First for portrait and the second for landscape , yet i dont succeed.
This is what i ddid for the portrait :
This is the landscape:
yat the this is what i get in the simulator:
portrait:
landscape:
As you can see , in the landscape i dont see the view.

You are using 3 different types of constrains :
Compact Regular Portrait on all phones
Regular Compact in Landscape for iPhone XS Max, iPhone XR and iPhone Plus phones 6+,7+,8+
Compact Compact in Landscape for iPhone X, iPhone 4s, iPhoneSE and iPhone 6,7,8
Try to add another 4 constrains of your 8 and it might work

Related

ios.googleAdUnitId bottom banner doesn't show on iPhone 6 and 6+ in landscape mode

I'm using ios.googleAdUnitId build hint to make the app showing the ads at bottom banner in Codename One. In portrait orientation, the ads is shown on all my iPad Mini, iPhone 6 and iPhone 6+ devices. However, in landscape orientation, the ads is only shown on iPad Mini. It is not shown on iPhone 6 and iPhone 6+. Any advice? thanks.
The layout uses padding at the bottom of the form to reserve space for the ad. However, if the layout takes up all the space the padding won't have space left and would effectively disappear.
You have 2 possible solutions I can see:
Fix the layout so it will shrink easily (e.g. make the content scrollable on the Y axis).
Lock the application to portrait only on iOS (you can do that from the iOS section in the preferences).

Keyboard issues in iphone 6 and 6 plus during orientation changes

I have an app which has one viewcontroller which works for both landscape as well portrait mode, Now when app goes to the landscape mode and coming back to portrait, the keyboard doesn't appear at all until app quits.
The issues is not related to iOS 8.0 for sure, because it works well in iPhone 5S with iOS 8.0 but it doesn't work for iPhone 6 and 6+. Also checked the keyboard frame and its shows correctly, but the keyboard doesn't show up. Any suggestion would be of great help.
Or is there a way i can force the keyboard to show up.
Did you try adding Launch Images for both the iPhone 6 and 6+? Without specific Launch Images for the 2 new device resolutions, the app will basically pretend that the width is still 320px and just stretch everything out to fit the bigger screen. I have seen this cause many strange problems with the keyboard on iPhone 6 and 6+ devices, and it sounds like this may be the underlying issue here as well. Here are the Launch Image resolutions you need for both devices:
For iPhone 6:
750 x 1334 (#2x) for portrait ---
1334 x 750 (#2x) for landscape
For iPhone 6 Plus:
1242 x 2208 (#3x) for portrait ---
2208 x 1242 (#3x) for landscape

When I run iPhone app on iPad the screen resolution is wrong. How to fix this?

I encountered with a strange problem. I develop an application which is targeting iPhone device family with Retina 3.5 and 4. All the time I used iPhone 5 simulator to test all the UI and functionality and everything was good but know I have to test push notifications. I have iPad 4 (model MD522ZP/A) as an iOS 6 device. When I run my app on it all the UI layout became wrong. The most weird problem is when I tried to check display resolution with this code:
NSLog(#"RESOLUTION = %#", NSStringFromCGSize([UIScreen mainScreen].bounds.size));
I got this : RESOLUTION = {320, 480}. But it is iPhone 3 resolution! Why iPad didn't use Retina 3.5/4 resolution ? And how can I fix it? I don't want to create separate xibs only for iPad testing but I want to test my app on it so that all the UI elements will fit on screen.
Hope for the help.
It's not wrong. It is doing exactly the right thing. All references to sizes are in points, not pixels. When you get the bounds, it will be 320x480 on all 3.5" screens whether they are retina or not. Try it on any 3.5" retina device. You will get the same log output.
The iPad does not emulate a 4" device when running an iPhone-only app. It will always be a 3.5" iPhone compatible mode.
So seeing 320x480 is the correct size to expect.
Think of it this way. A retina iPad will show an iPhone-only app like it is running on a 3.5" retina iPhone. A non-retina iPad will show an iPhone-only app like it is running on a 3.5" non-retina iPhone.

Launch splash screen in Landscape mode for iPhone 5

Our universal application is in Landscape mode only. We need to add a splash screen for iPhone 4 & iPhone 5.
For iPhone 5 in Portrait we use Default-568h#2x.png. How to set a launch screen in Landscape for iPhone 5?
According to Apple's Documentation : Providing Launch Images for Different Orientations
,
Each orientation-specific launch image must include a special modifier string in its filename. The format for orientation-specific launch image filenames is as follows:
<basename><orientation_modifier><scale_modifier><device_modifier>.png
Eg :
1) Default-Portrait.png
2) Default-PortraitUpsideDown.png
3) Default-Landscape.png
4) Default-LandscapeLeft.png
5) Default-LandscapeRight.png
Note : These modifiers are supported for launch images used in iPad apps only.
So you have to change your Image according to the Orientation for iPhone 5.
Two ways to do that :
1) Rotating the Splash Image to 90 Degree.
2) Inverting the Dimensions (320 * 480 -> 480 * 320).
to provide a landscape launch image you must create the image.. and just rotate it 90 degrees in an external image editor
Very simple
make design on splash screen in landscape mode .
and just make splash screen as you do in portrait .
user automatically make phone landscape when he/she see screen is in landscape :-)
From Apple doc, landscapes launch screens are supported for iPad only.
For iPhone and iPod Touch, you need to create a portrait launch screen that can be your 90°-oriented landscape launch screen. I would apply a clockwise rotation rather than a counter-clockwise rotation (ie so that on a desktop, you need to bend your head on the right to see the image with the correct orientation).
use these macros in pch file
#if IS_iPAD
LaunchImage=iPad.png
else
LaunchImage=iPhone.png

What is the difference between coordinate systems for iPad and iPhone?

I'm trying to make an application in cocos2d that can be used on multiple platforms (iPad, iPhone, iPod touch). Let's say I set a point to (360,160). The point would show up three fourths from the left and half way up the screen on the iPhone. Would it also do this on the ipad, or would I have to set the point to (768,384) to achieve this result? or does it stretch the screen. I figured I would have to, but am unsure because when I get the size of the screen during an iPhone OR iPad simulation, I always get 480x320 regardless.
Ignoring the iPhone 4 for the moment, the devices map their screens 1:1 with their coordinate spaces, so the iPhone has a coordinate space with size 320x480 (or 480x320 in landscape mode) while the iPad has a coordinate space with size 768x1024 (or 1024x768 in landscape mode.)
The iPhone 4, of course, quadruples the device pixels, but maintains an identical coordinate space to other iPhones and scales drawing to match the screen's resolution.
Note: if you get the same resolution running on the iPad Simulator it means you did not convert your project as an iPad project. Or you did not start it as a native iPad application but rather the iPhone App within the iPad Simulator.
Make sure you have gone through upgrading your target to iPad -> Xcode: Project menu, choose Upgrade Target for iPad
When running in the Simulator make sure you chose iPad Simulator as Active Executable.