iPhone UI Offset Issue - iphone

I have an iPhone app and for some reason it is moving all the UI elements up the height of the status bar, and they are going under the status bar.
And I have set up the UI with Interface Builder

I answered a similar question yesterday. Likely the solution for you is also similar.
Open up the view's .xib in Interface Builder, and Bring up the Attributes Inspector (Cmd-1). Then make sure the Simulated User Interface Elements setting for Status Bar is not set to None.

Related

How to handle alignment of UI on phone call?

I am developing iPhone app for iOS 5 or above version, and making use of storyboard for UI design. My problem is when i am on phone call my UI gets misaligned because my upper status bar is taking 20 to 30 pixel of screen space.
How to handle my UI when i am on phone call?
I finally got answer for my question. Following are the things i made changes in my project and everything started working fine.
Took sliced images of all the things needed in my UI. (Initially
i was taking common image to save slicing time)
Made you of autoResizingMask property. It help me save my lots of time. Just make sure only 3 arrows top, left and right one is in ON state and your work is over.
For making everyones search easy i will add following Stackoverflow links to save your time
How to position view below green bar during phone call?
Resize for in-call status bar?
How do I detect a double-height status bar?
How to Remove Status Bar in "View Based Application" - iOS
how to hide status bar in Iphone application
How In-Call status bar impacts UIViewController's view size ? (and how to handle it properly)
iPhone Programming In Call Status Bar
resize content after iPhone status bar is shown/hidden
How to programmatically get iOS status bar height
How is the in-call status bar impacting my CGAffineTransform'd view?
View resize when In-Call Status Bar changes
Thanks to all the people who have replied to all the questions above. It made my big problem resolved.

UIStepper does not move up when Navigation Bar dissapears

I am writing a IPhone App. In it there is a search bar (UISearchBar with Controller). When I select it, it gets focussed, and the navigation bar disappears, and the body gets darkened so that when I type on search bar the suggestions (search results) appear. My problem is when I select the search bar, before I type anything, I can see my original view through a tinted black body area. There I see all of my other controls (buttons, textfields) moved up (because navigation bar disappeared), but the UISteppers have not moved, which makes them misaligned.
Why is this ?
It may depend on how you have the relative alignment setup. In your Storyboard, use the Inspector (the ruler icon on the right hand side options) and see if you have set the others to be relative.
I believe this is a bug. I have noticed the same exact behavior in several apps I have worked on (both iPad and iPhone) Storyboard based apps. I have re-produced this behavior on apps with only one orientation. To re-produce, simply layout a scene and add UI elements of different types with at least one UIStepper. Then add the scene to a Nav Controller and all the UI elements will move EXCEPT for any UISteppers.

iphone popup custom size in IB

In my application I need show some info popup. This is just a text message above an image. When I create UIView for my popup in IB, it's size is non-ediatable (and equals to 320x460).
But my popup is not full-screen size.
Of course, I can create this popup programmatically, but I'd prefer data-driven approach.
So, the question is: how do I create custom-size UIView in IB?
If you set status bar of the view to none then you should be able to resize the view.
When a view is at the root level in an interface builder document it will always appear to be 320x460 but the size isn't actually set. Interface builder is just simulating what it will look like when it's actually loaded.
If this Popup view is actually supposed to appear in another existing view then drag it inside that view in IB. Once it's no longer at the root level you will be able to set its size.

[iPhone]A zone which user can't interact, why?

Plese refer to below image to get detail of my problem:
This maybe relate to Status bar???
*Note: this is a full-screen application. My way to do this:
1. add "Status bar is initially hidden" information property to xxx-Info.plist.
2. In all screen of app: set "Status Bar" to none.
You are likely loading a nib with your control set to 320x460, instead of 320x480. Post how you are generating this view and we can help more.
Is this happening on the device or just in the simulator?
The simulator has/had bugs that stop it reporting touches in the status bar area.
It really does look that your view is not big enough, and is sized to a screen with the status bar.
How do you create the UIControl? Using a NIB? What's the frame you assign to it? Post some code.

Button has moved upwards when running app in Simulator

I have a strange problem when developing for the iPhone
There is one window (in green) and one view (in orange)
when I try to test my app it looks like this in the iPhone Simulator
you can see the view have moved upwards
is this normal? and how to solve the problem?
many thanks
You're most likely adding the view incorrectly. You could post some code and I could give you a better idea, or if you just want a quick fix, open the orange view in Interface Builder, make it 480 px tall instead of 460, show the simulated status bar and relayout your image.
In Interface Builder you can specify the simulated User interface elements. In the screenshots above you will notice in the green one you can see the status bar and the red one doesn't have it. You can turn on these elements by setting the properties of the view. Press Command-1 when you have the view selected and you will see a list of simulates ui elements you can add, these include the status bar, navigation controller bar and a few others i cant remember off the top of my head. This will allow you to position your ui elements correctly when you have these other elements on the screen.
The other issue with your view is that it is not the same height. have a look at the dimensions (cant remember exactly which one but its Command-2, 3 or 4 when you have the view selected) it should be 320x480, i reckon yours is 320x460... (20 pixels, the height of the status bar)