iPad UI clipped in simulator - iphone

My views created for iPad form factor look fine in Interface Builder. However, when I debug my app in iPhone Simulator 3.2 (with Hardware -> Device set to iPad), I see the UI clipped and about half size. There is a 2x button at the bottom which lets me zoom in. But this just shows the same clipped UI in double size.
This is really weird since I have created the XIB for iPad form factor and it is supposed to fit iPad completely. Any ideas what I might be doing wrong?
I am using iPhone SDK 3.2 downloaded on 4/30/2010.
Thanks.
-Raj

It sounds like you've accidentally created an iphone project, rather than an ipad project. In the "New Project Dialog", make sure you select iPad from the "Product" dropdown in the middle of the dialog:
alt text http://www.freeimagehosting.net/uploads/7f49d44254.png

Related

iOS 7 in iPad eliminate x2 button for iPhone app

I am new here. I have an iOS 6.1 iPhone application. When I try to run it in iPad running iOS 7, the x2 zoom button at the right corner is gone and my iPhone application UI mess up with the wrong position. The UIWebView is stretched over size for iPad. How can I solve this problem? Should I change it manually?
As my comment seems to be the actual answer, I post it again as an answer.
Setting the App to be an Universal App and only providing a Storyboard for iPhone/iPod will result in this behavior. The iPad tries to use the iPhone Storyboard to display the App on the whole screen in full size without the 2x button. Thus all elements in the App will be positioned according to their positions defined for iPhone size display.
The solution here is to set the App available for iPhone only (in App target > Deployment info > Devices > [select iPhone here]) instead of Universal. This will result in the iPad to display the App on iPhone size and provide the 2x button to zoom in.

Will releasing an iPhone app makes it available for iPad by default?

In my XCode's Targets summary screen, the "Devices" drop down is set to "iPhone" (other possible values are iPad and Universal) because I haven't fine tuned the app's UI for iPad. However, will people be able to download and run my app from the iPad in non-fullscreen? (e.g., with black border surrounding most of the screen)
I want people to be able to search for it in app store, install it, and run it even though it is not full screen.
Even though your device settings for app is iPhone, you can download it from iPad, but it can be viewed only as in iphone size or in 2x option is there on right bottom side of the app (refer image) to double the app size in ipad; but doubled view will look stretched.
An iphone app downloaded to ipad will look like as shown (In 1x mode).
If it's on the app store as an iPhone app then you can still run it on the iPad but they'll run in their original size unless you change the size to fit using the 1x or 2x icon. The graphics won't be as sharp and if your app uses any iPhone only features - make calls, then it's not going to work as expected.
If you want to get rid of the little iPhone app inside the iPad then you'll need to change the target to Universal in order to run as a native iPad app
What type build you use? XIB or Storyboard?
In any case go to the drop down menu and set Universal App, xcode create automatically the Xib or storyboard target for iPad, and the app run in full screen on iPad.
Ok now you have to setting up a new interface specific fo iPad:
if you use a xib files, you have to only resize the interface target for iPad.
if you use a Storyboard, in order you have to
Right click on your project and click on NewFile
add New Storyboard target fon iPad
Now you have a new storyboard for ipad, but is empty and not linked, so go to you project setting and set the new story under the iPad settings, click on iPhone Storyboard and pres CMD + A select all inside your storyboard for iPhone go to your storyboard for iPad and again CMD + A and press CANC Yes delete all inside a iPad Storyboard and press CMD + V now you have copy all your project correctly target for ipad but now you need to relink and resize all stuff.
Hope this help you and other people, do not forget vote up ;)

App runs on iphone 5 like iphone 4

I have finally done to build Augmented Reality app.
The app works great for iphone 4 screen size Width :480 Height :320.
During the development I have also test the simulator to see launch goes well for 4 inch display (iphone 5), and it did go well the splash screen show was the 4 inch png named : Default-568h#2x.png and the screen shows a white background fully (like it should).
When I launch the app on a real iphone 5 device, the 3.5 inch splash screen loaded and the app load like it loads on iphone 4. Everything in the middle and I get a little black equal Margins from the side, the cable is original and this is the Weirdest thing ever happened to me.
UPDATE : i have also tried to add this code on the simulator and to the real device :
CGRect bounds = [[UIScreen mainScreen]bounds];
NSLog(#"%#",NSStringFromCGRect(bounds));
the simulator prints iphone 5 screen size, the real device prints iphone 4 size.
Any help please
Make sure you have all three Launch images set up correctly. :)
Make sure the image has been added to the target.
=> If you select your image file in the Project Navigator (left pane) the Utilities pane (right pane) should have a checkmark under 'Target Membership' next to your target.
I think that your views need to resize. You may need to include some code that detects what device the person is using and resizes the view. Just a suggestion.

View doesn't take up full screen on iPad

Simply that. I'm working on an iPhone (iOS) game that loads without using .xib files. Window and view is created programmatically. It automatically detects resolution and retina display and adjusts accordingly.
However when run on and iPad (only have the simulator for iPad), it shows up in a mini window that same size as the iPhone resolution, with a little 2x button in the bottom-right corner. I want it to load fullscreen with full resolution (larger res than the phone). Everything will scale accordingly so it would look the same as on the phone, and look just as crisp.
Why does this happen? Why doesn't the window automatically take up the fullscreen like it does on iPhone?
After much searching, I've found this template: https://github.com/ryanscott/rcloudlib/blob/master/Samples/clean_universal_app_template.zip
which loads properly for me on both iPhone and iPad.
Looking at the code, however, it does nothing differant than what I am doing. All it does is check which device is being used, and loads the appropriate app delegate, which in this case contain the exact same code, albeit for background color. This is clearly aimed towards those who want to have a different view load on iPhone vs. iPad, while avoiding using nibs. I want the SAME view across all devices, so I have no need to use multiple delegates or the like.
How can I force the app delegate to use the fullscreen regardless of device?
In your Xcode project file, find your target, go to the Summary tab and make sure that Devices is set to Universal under iOS Application Target
Yup! In Xcode 6 the "Devices" option is now called "Deployment Target" and is located here:

How do I provide iPad and iPhone 5 versions if I use .xib files?

I have a very simple app that just displays a block of text every time you touch the screen. I have a graphic behind the text, that the basics of it.
I made it back in 2010 using a .xib file to create the text field and the image.
I'm now attempting to make it fit both iPhone 5 and both iPad and iPad Retina.
I can't simply stretch out the existing .xib layout because it just accepts and renders the last one I do. (If I stretch to iPhone 5 resolution it goes off the screen on an iPhone 4S).
Is there anyway to reference different .xib files based on the iOS device?
Thank You.
According to the documentation, you can use:
myNibName~ipad.xib and
myNibName~iphone.xib
and the correct xib will be loaded depending on the device.
You can read iOS Supports Device-Specific Resources.
EDIT:
how do you distinguish between iPhone 3.5" vs iPhone 4.0"
there is no device modifier specific to the iPhone 4". You will have to define your nib in a way that it can "stretch" vertically.
The only mechanism is a iPhone 4" specific Default-586#2x.png file. If you provide it, then the whole screen area will be available to your app.
If you do not provide it, then the app will run in a special mode whereby its content is presented in a 3.5" area. The remaining area is filled with a top and a bottom black band.
iPad vs iPad Retina?
nothing special here, since the 2 devices share the same "logical" resolution of 768x1024 pixels. As usual, you can use #2x modifier to supply specific retina-resolution images; and, if you need it, you can use ~ipad#2x modifier to supply retina iPad-only images.
E.g.:
iconImage.png -> non-retina iPhone version
iconImage#2x.png -> retina iPhone version (also retina iPad version if no ~iPad is given)
iconImage~iPad.png -> non-retina iPad version
iconImage~iPad#2x.png -> retina iPad version
EDIT:
To make your UI stretch, go to the metrics pane in IB and set the vertical spring for the view height (this is the inner vertical double arrow in the picture below).
You will have to find your way through this a bit, especially if you have a lot of subviews.