Making use of the extra pixels on 1136x640 iPhone 5 Screen? - iphone

Without the 1136 launch image, apps now run in letterbox mode with black bars on either end.
If you add the Default-568h#2x.png launch image, then the app runs with 1136 pixels (in my case, in landscape mode - 1136x640).
The extra 176 pixels are all getting added to the right side of the screen in landscape mode.
Is there a way that I could have the 176 added pixels distributed 88 to the left and 88 to the right of the screen that I work with in Interface Builder?
To Explain:
If I position an 1136x640 image (to make it work it is actually a 568x320 image with an #2x version in the project) at 0,0 in Interface Builder and run it on an iPhone 5/simulator, the screen shows the entire image even though it's not entirely visible in Interface Builder since it goes off the right side of the screen.
I was hoping to place the 1136x640 image at -88,0 since it is just a background image for my app. If this was possible, I could keep all the menu buttons in their current locations and would just be able to extend my app's background to either end instead of having that area be filled with black bars in letterbox mode.
If that is somehow possible I would love to hear about it... otherwise I better get to repositioning all my buttons and other screen elements! I've recently read about AutoLayout and that is certainly something to strongly consider in any new apps going forward, but I was just hoping for a quick update to my existing apps that would letterbox the apps with additional background art provided by me instead of black bars on either end.
EDIT: Just tried to move buttons around on the screen and it appears that buttons placed on the right-most 176 pixels can't even be clicked on! So I cannot use that extra space on the right even if I reposition everything... =/
AND THEN: I tried AutoLayout, and it too ignored the 176 pixels on the right. If I positioned a button with a constraint of 20 pixels from the right side of the screen, it would show 196 pixels from the right because it's not taking into account the additional screen size that has been added.
Anybody know what is the best way to actually have art fill the entire screen of the new iPhone 5?
Thanks!

I had the same problem of not being able to access the new 176 pixels for the new iPhone. However, this is what I did and now I have access to them.
Open MainWindow.xib with Interface Builder
Select the Window
In Attributes, check Visible at Launch and Full Screen at Launch.

If you hadn't set autoresizing on any of your elements and then enable support for the 4-inch display, indeed you might not have the greatest looking views.
You can use autoresizing to set your views/elements to stretch, center and align, so you should be able to manipulate the resizing mask to do what you'd like.
Autolayout is very fiddly and in most cases overkill if you just want to support the new screen size.

Ended up creating one .xib for for the iPhone 5 size and one .xib for the iPhone 4 size. Both are connected to the same .h/.m file.

Related

Unity, at higher resolution (2560 x 1440) tester cannot click the navigation elements on the screen even though they are in position

Here is my issue, the way my game works is that you click on the edges of the screen to navigate. This is done through an Overlay Canvas using OnPointerClick. I colored the navigation areas, and scale the canvas according to screen size and the navigation areas appear on their screen as they should. Yet they CANNOT click any of the elements for some reason. They have another monitor that works without issue. They've noted that their larger monitor is AMD. I've also confirmed that the ability to navigate in game has not been hindered. I have never had this issue (or any other testers) on 1920x1080 monitors.
I have completely exhausted what the issue can be, they cannot even navigate on a bare bones tutorial. Any ideas would be GREATLY appreciated.
Here is an image of their screen and the respective clickable navigation areas.
[img]https://i.imgur.com/NVQkA8g.png[/img]
Unity 2019.2.14f1
Put a Image component without sprite, because without that, you will not detect any click. You can set the alpha to 0 after you see that working.
Also check the anchors of the navigation areas.

Keep Graphical Outline when Screen Size Changes

Beginner...
I suppose somewhat related to the question below, I would like the view controller to appear the same on each device with only the size of the graphics changed, (storyboard iPhone 8 vs iPhone 4s)
I've tried my best to read about and understand the Constraints, but with no luck. I add a constraint, then click away from the "Add New Constraints", and when I select the object again to view constraints it appears as if nothing is set anymore, (Constraints added & Constraints gone)
Even if they are sill there, but this isn't how you see them, the image still moves when I check the storyboards or the simulators of two different sized devices.
Any recommendations on how to fix either issue or just somewhere else to look for answers would be well received!
I would like to automatically align all the graphics I've placed in the "View Controller", (Unaligned Storyboard),
and have those graphics resize themselves to maintain their placement when loaded onto a device with a different size screen, (Main Storyboard of two devices)
I've decided I want most of the graphics to only be in the center of the controller.
EDIT
this has been solved
I've discovered how to align the graphics as I desire by clicking the Align "Horizontally in Container"
I'm not sure how or why I didn't see this sooner.
Unfortunately, the graphics still become distorted when on a different sized screen.
I've discovered how to align the graphics as I desire by clicking the Align "Horizontally in Container"
I'm not sure how or why I didn't see this sooner.
Unfortunately, the graphics still become distorted when on a different sized screen.

Auto Layout Swift 4 Xcode 9 For Multiple Devices - Am I doing it Wrong?

I am having severe difficulties finding a clear working world example of auto layout on multiple screen sizes. Most tutorials have basic stuff like a button thats centralised and then after adding constraints in Interface Builder it scales with the device. One button is simple but in my example for the iPhone 4:
There are quite a lot of labels / buttons and some that are not central. The above screen shot is exactly how I want it to look on all devices.
The app is for portrait only but I want to target all devices. I tried slowly adding constraints to items from the bottom up using a multiple of the superview to position and size items and then applying aspect ratio to UI Objects (got as far as the got it button but not the red arrow buttons) but as you can see in the next picture for the iPhone 8 plus... the white space isn't going to perfectly fill like in the iPhone 4 which will leave me with a big gap at the top.
Is there a way I can change just the iPhone 8 plus layout in Interface Builder to build a layout that caters for the extra screen size?
The iPhone 8, SE and X layouts are equally awkward with extra white space.
I tried size classes but that changes it for all phones.
Is there a way to centre what I have done so far?
How do you guys position objects in auto layout that are not centred?
Am I going about it the wrong way by applying X / Y constraints using a multiple of the superview? - same for the width. I'm only specifying widths as a multiple of the superviews width then adding aspect ratio.
I just need a real world working example I can learn the basics from or a system to create for multiple devices that I can follow. I don't want to use a 3rd party library.
I really hope someone can help point me in the right direction!
Krivvenz.

Xcode - Resize Buttons with Images Proportionally for iPhone 4s, 5, 6, 6+ in AutoLayout

I designed a UI that simply doesn't scale the right way - always squeezing and stretching something. I get everything to align the right way but the scaling messes everything up. In Subviews it even gets worse...
Here is a simplified version of the UI:
http:// i.imgur.com/VIKVm5y.png
All the grey circles have images inside, should be buttons and scale proportional to every iPhone display size - so that a bigger display gets bigger buttons...
It's only meant to be for iPhones and portrait mode only.
Ok actually this was pretty simple and I feel kinda stupid I asked the question in the first place.
The solution was to lock the aspect ratio and set either the height or with equal to the superview and then edit the proportion to it in a second step until you have desired result...

touch button aerea (iPhone,iPad)

I have got this situation:
this is the photo: http://imageshack.us/photo/my-images/826/iconepe.png/
the two images are little 20 pixel x pixel, If I click on them, nothing happens, if I click oh the left on them, the link works. I should make images bigger?
My guess is that you are missing the buttons with your finger.
The comfortable minimum size of tappable UI elements is 44 x 44
points.
According to the iOS Human Interface Guidelines
If you need to keep the images this small, one workaround would be to increase the size (frame) of the button and keep the image (the image must be set as a button image, not background image). This way you'd have a bigger zone that will accept input and still use the same image.
Ask your designer to make the image bigger, by using a transparent space around it.. 20x20 is too small to touch.. Apple says that the avg finger tap is 44x44 (from WWDC). All table rows are recommended to be at least that height. Use a transparent padding to make your image atleast 44 * 44.