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.
Related
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.
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 experiencing a very strange problem where the built in controls in my iPhone app are animating in slow motion. These are controls that I have not implemented, like the TopBar on a ViewController. In this case, the title and buttons all, slowly move from the outer edge of the screen to their designated final destinations. It's like my app has slowed down and is showing me a debug version so I can see how the various pieces all move into place. I am embedding an link to an animation I created showing the problem.
http://icandy.ricohinnovations.com/images/navbar_animation_problem.gif
I have found that, in some cases, I have fixed the issue by removing a .xib file from the project. But making changes to the same .xib file have not worked. Does this mean there could be an issue with one or more of my .xib files?
Thanks in advance for any suggestions or help.
Just a silly question that just cant figure out. Ive been working on iPad apps for a while but now Im back on an iphone project.
I created an iphone 4.0 sdk based project but when i double tap on a xib file, IB comes with iPad layout and i cant figure out how to switch it back to iphone layout.
Anyone?
When you create the project, be sure to select Product = iPhone in the "New Project" window.
Also, if you already have the iPad views, you can transform them to iPod/iPhone views through File->Create iPod/iPhone Version using autosizing masks
Partially solved,solution sucks. i created a view based project and there IB shows xib with iphone layout. Couldnt find a solution yet when creating a window based project.
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.)