I have an iPhone app that I'd like to convert to an iPad app. To do so, I "Upgrade(d) Current Target for iPad", and then I got a new xib, "MainWindow-iPad.xib". I was building to iPhone/iPad, and correctly had the iPad main window xib set in info.plist. However, when I opened the MainWindow-iPad xib, I was presented with an iPhone-sized window, instead of an iPad-sized window as I expected. Is there something I need to do after upgrading to change the xib, or do I need to resize views somewhere? Because when I run the app, it seems as if XCode is trying to run an iPad view with an iPhone-sized xib.
Thanks for any help in advance.
I had the same problem and the window size was wrong in the mainWindow.xib.
I had manually converted a I-Phone project to an I-Pad project. I resized all my views, but couldn't change the size of the window. It appears that you can have views bigger than the window, and the only thing that happens is that buttons outside the window don't work. that of course is dependent on the rotation of the I-Pad.
From the Interface builder, the size is greyed out in the mainWindow info. I opened the mainWindow.xib as text, changed the size to 768 by 1024, saved, cleaned and rebuilt. Unexpected errors occurred until I exited from the Xcode and IB and restarted. The next build worked just fine, and the buttons now work.
It's probably the wrong way to fix the problem, but it works
I think there's a bug in the "Upgrade Current Target for iPad" task.
I fixed this issue by creating a new "Window XIB" with iPad as the product, then replacing the Window object in MainWindow-iPad.xib with the Window object in the new XIB. (Be sure to update the "window" outlet of your app delegate.)
Related
i am developing ios 8 app using swift. i got some problem with viewcontroller layout in the storyboard. when i add the viewcontroller, i only get iphone size but not ipad size. my app is only focus on ipad not even universal application. i checked size in "simulated metrics" but there is no size for ipad except all iphone sizes.
but i create new storyboard and add the viewcontroller. there is no totally issue at all. so what happened to my existing storyboard? and how can i fix it?
Thanks,
frog
Select the storyboard in the Project navigator. Use the File inspector and enable Size Classes (it's a checkbox). That solves it.
If you really don't like enabling Size Classes, now disable Size Classes again - but when the dialog appears, specify that you want to keep the iPad size class data. (Really, though, you should be using Size Classes if this is an iOS 8 app.)
I'm trying to update an app to add support for the iPhone 5. Based on other threads I have seen, I have added the Default-568h#2x.png as specified and I have added some new background images to the app that are sized appropriately. The problem is that the bottom portion of my app does not seem to be responding to touch (I have a page control and an info button).
Additionally, when switching screens (using the following code):
[self presentModalViewController:tableNavController animated:YES];
The bottom of the screen blacks out. This black section is basically exactly where I am unable to touch. Screenshot of this issue is below:
Any ideas on why this would be happening? Why I cannot access this bottom section? Note if I run the regular iPhone 4S or iPad simulator this does not happen. I can access the entire section of the screen.
Edit: Could it be a simulator problem? I do not have a physical iPhone 5 yet, so I am unable to test it on a real device.
Edit2: I have tried both enabling and disabling Auto-Layout on both the views and the applications main window. If I add the following log statement to viewDidLoad:
NSLog(#"Window is: %0.0fx%0.0f", window.frame.size.width, window.frame.size.height);
NSLog(#"View is: %0.0fx%0.0f", viewController.view.frame.size.width, viewController.view.frame.size.height);
I receive Window is: 320x480. View is: 320x548. So it looks like it may be a problem with my window. I will continue to investigate.
Figured it out. The main window was not getting resized although the view was. I deleted the window from my xib, created a new one and re-linked it. That solved the issue.
This can be solved by enabling "Full screen at launch" on the window. Deleting and recreating merely enables this.
A simpler solution is to select the window and switch to the Attributes inspector. Change Size to Retina 4 Full Screen.
A simpler solution is to select the window and switch to the
Attributes inspector. Change Size to Retina 4 Full Screen.
Steven's answer is correct, mostly. However now your window is larger than the screen on the 3.5" devices, and the right size on the 4" devices. Basically you will either have to adjust the window size at run-time if you later have anything that references the window, since that will return the 4" window otherwise.
for instance if you used this in your code
[[[UIApplication sharedApplication] delegate] window]
Just be careful with this, that being said it will work for most applications.
I recently developed an Application on iPhone in Xcode version 4.1.
Now I need to convert this app for iPad also.
I have verified so many links but all are regardig Xcode 3 ond it's extensions.
How to upgrade, how to resize the view etc etc Please help me. Thanks in advance
Okay, first open your project and click on the project icon, then select the icon below Targets. Select Summary from the right hand side, and change the Devices from iPhone to Universal (under the iOS Application Target). Now your app is ready for iPad. Now to modify the views, if you are not using XIB files, go to your view controllers viewDidLoad / loadView method and write the following code:
if(UI_USER_INTERFACE_IDIOM())
{
// re-size your views here
}
And if you are using XIB files, go to your viewcontrollers XIB file, select the view(i.e view window, label, buttons etc.) and select Show Size Inspector from Utilities.
Now you can see Autosizing panel just under the origins and height-width menu. Select the arrows inside box to set autoResizeMask to get the desired size in iPad and then select the arrows outside the box to set the position in iPad.
And that's it, hope this helps you :) Cheers!
Thanks everyone for helping me out. It turns out that this tutorial explained what I needed.
http://www.youtube.com/watch?v=RY-btZ-KjX0
It might be helpful for others.
I am trying to add a UIWindow through interface builder.
Whenever i drag a window from the library, its default size is 320x480
As I am designing an app for iPad, I want this to be 768x1024
The values are greyed out but changes when resizing with the help of mouse.
Any one had this Issue before?
Any help is appreciated.
Thanks
You should use UIViews instead of UIWindows.
Edit: Sorry, didn't read correctly. Here my answer after reading carefully: Is the device set to iPad in the target section? Did you try to delete the xib and add a new MainWindow.xib.
So I'm new to programming but I'm managed to create the groundwork for an iPhone app.
Problem is, when I run it on the iPhone simulator, it first shows up as a white/blank screen (with the status bar at the top) until I hit the home button. When it is doing the minimization animation (~0.5 second) the app will display correctly.
I know that an issue with versions could be the cause of this but I'd need to buy a newer Mac to upgrade to the latest version of Xcode. If there are other issues that could be causing this I'd love to know
thanks :)
Add Default.png image to your application and see if it shows that during loading. Run the app in debugger and add a breakpoint to viewDidAppear in your viewController. It's probably running but not loading in the view you are expecting it to for some reason.
To some viewcontroller's view your are not setting the background color as clear color .. that's why it is showing blank white screen when your application is launching .. if your are using xib .. set the background color of that view to clear color using interface builder.