ipad rotation hides elements in view ! - iphone

OK here is a very basic iPad app that i am starting out with and I am already into issue. I have been doing iphone apps but in that too never implemented rotation things.. well here is the issue. This is a simple viewbased app build with interface builder that looks like this:
when i run the app, the vertical orientation has both elements like this :
However, when the orientation changes to horizontal, the app hides the label which is at the top.. :
Suggestions please !

In Interface Builder, select the label, then open the size inspector and in Autosizing section make the label stick to the upper edge of the window. You may also need to stick it to the left and/or right edge and make it change the width - depending on how you want it to be resized when orientation changes.

Related

How to well adapt height and position of views in iOS without AutoLayout?

I am building a view in Storyboard. I have three parts :
1) top : real-time camera view (adaptive height)
2) middle : small webview (fixed height)
3) bottom : some buttons (fixed height)
I would like to know how to properly make my interface in the storyboard for a compatibility with iPhone 4 or iPhone 5 screens.
My goal is to have the camera having a bigger part of the screen on iPhone 5 (or any bigger screen) and the webview and buttons to have the exact same height on any device.
I did it quite well with the AutoLayout feature. The only problem is that it is available since iOS6 and my app has to work from iOS5 and above.
My Storyboard has an 4' display and when I try to run it on a real device (iPhone 4S) all the bottom of the screen is cropped and I can't see my buttons. I really can't figure it out what is really the best and proper way to do it. For a such simple problem, I shouldn't build two different storyboards.
Maybe should I try to fix the height of the camera view programmatically, but this won't fix the problem of the bottom of the screen cropped on smaller screens (I should then modify the position programmatically).
You can see that I haven't a really nice solution to my problem. Could someone help me in how using well the tools in XCode for this case ?
Thanks
Try this:
Xcode 4.5: How do I fix my text views so they display properly in portrait and landscape mode on an iPad?
I think this could fix your problem and if you are using Storyboards it makes it less difficult.

UIImageView is shifting down when viewed on 4 inch iphone

I am trying to figure out what settings for the UIImageView below will work with all device sizes.
I'm getting no luck with every combination I've tried.
Here's the .xib:
When I run this on a 4" the image is shifted down much lower from the top label and the buttons stay put.
I have the top label set to Top, tried Aspect Fit/Fill for it as well, didn't change anything. Seems to be an issue with the UIImageView. Also saw someone mention try clip subviews, have that selected, still can't keep it the same size and orientation when going back and forth from 3.5" to 4" iphone on device and simulator.
Hope this helps, in your case you should keep it to the default setting, no change required..
First if turn off the Autolayout setting from XIB.
Now visit my answer here.

My button doesn't detect touch events on iPhone (Retina 4-inch) simulator, but works in iPhone (Retina 3.5-inch) simulator

I'm getting my app ready for the iPhone 5 using the simulator and I've found a weird issue where a couple of my buttons, in one of my views, don't work in the iPhone (Retina 4-inch) simulator, but work fine in the iPhone (Retina 3.5-inch) simulator. The buttons simply don't do anything when they're tapped. Has anyone else experienced this issue?
I having a difficult time figuring out where to start with this one. Any suggestions on where to start?
Thanks so much in advance for all your wisdom!
You need to edit your MainWindow.xib and enable "Full Screen at Launch". For a more detailed explanation, see Apple's docs:
Important: When creating your window in Interface Builder, it is
recommended that you enable the Full Screen at Launch option in the
attributes inspector. If this option is not enabled and your window is
smaller than the screen of the target device, touch events will not be
received by some of your views. This is because windows (like all
views) do not receive touch events outside of their bounds rectangle.
Because views are not clipped to the window’s bounds by default, the
views still appear visible but events do not reach them. Enabling the
Full Screen at Launch option ensures that the window is sized
appropriately for the current screen.
Complete document from Apple
For me, the solution was to set the size ("Simulated Metrics") to "Retina 4 Full Screen" for the MainWindow.xib. I did not need to alter the size of the other screens (they are still set to None). After changing the MainWindow.xib the bottom area becomes clickable again...
The problem was caused by another control overlapping my buttons due to the way the springs and struts were setup. Adjusting the z-order of the buttons fixed the issue. Thanks, all!
There are two solution to this problem :
If you are using MainWindow follow these steps :
a. Select MainWindow.xib.
b. Select Full Screen at Launch from Windows option available in Attributes Inspector.
If your application doesn't contain MainWindow then just add:
self.view.frame = [UIScreen mainScreen].bounds
in ViewDidLoad.
I solved my prob.
view .origin for 3.5 inch and 4 inch screen are different so, when writing common code for both we need to take care at giving CGRectmake(x,y,w,h);
Set temp. diff background color of diff view so you can check if any view is overlapping or not, to fetch event in 4.0 inch.

Interface builder problem when Iphone app converted to Universal app

I built an iphone app and in one of the views(buit using IB), I put an activity indicator ( little spinner indicating network activity) in the middle. It works fine on my iphone but once I use an Ipad the spinner goes to the to left corner. So the spinner never correspond to the intended location on Ipad no matter where I move it in IB.
Any suggestion to solve this problem? Do I have to rebuild the app specifically for ipad?
Thanks
In Interface Builder, select the Activity Indicator and open the Size Inspector.
Default shortcut in Xcode 4 is ⌥ ⌘ 5, icon looks like a ruler.
Second section, on the left, a box labeled "Autosizing". The bars around the outside turn each anchor on or off, and the arrows inside turn autoresizing on/off for either direction (x / y)
With the indicator centered in the view, turn all four anchors on.
Solid red is on, semitransparent is off.

First iPhone App View Position Problem

I am closely following the instructions given in the tutorial "Your First iPhone Application" on apple ADC.
In the interface builder, I have set up a button positioned on the top according to the Apple Interface Guidelines. It runs without trouble if I simulate the interface in IB. However, if I run the built app, I get what is shown here.
If you look at the view clearly, you will see that the entire view has been shifted up. And the magnitude of the shift is exactly the height of the status bar. And that's why the there is blank space at the bottom of the window, which was white instead of red.
I have tried turning on the "Simulated Interface Elements", but that doesn't work either.
The problem persists on real devices as well.
However, using the "Simulate Interface" from IB looks fine.
Any help is appreciated.
Yun Tao
Are you setting the frame of your view?