iPad window size problem

Member
Posts: 21
Joined: 2009.10
Post: #1
Heya! I picked up an iPad over the weekend - huzzah! Wow Now I've been trying to port one of my uni projects to it - but I've run into a problem: the project builds for and runs on the iPad okay... but only in an iPhone-sized rectangle at the top-left of the iPad's screen. I've delved into Interface Builder, but I can't edit the size of the window - the entry boxes for the window's size are greyed out Sad Is anybody able to suggest a solution? Thanks!
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #2
You have to make an Info.plist modification to tell iPhone OS that your app can run in iPad mode, like this:

Code:
    <key>UIDeviceFamily</key>
    <array>
        <integer>1</integer>
        <integer>2</integer>
    </array>

UIDeviceFamily is an array of supported device types, where 1 means iPhone and 2 means iPad. Adding the 2 should allow your app to use the full iPad screen, though there may be other problems to resolve once that's fixed.

Small disclaimer: I develop without Xcode, so there may be a way to do this within Xcode's paradigms without modifying Info.plist directly that I don't know about.
Quote this message in a reply
Member
Posts: 21
Joined: 2009.10
Post: #3
Heya ThemsAllTook! I've tried your suggestion but it doesn't seem to make any difference Sad To clarify, I'm not trying to build an app which can run both on the iPhone and on the iPad - I'm trying to port a project from the iPhone to the iPad.

If I open ''MainWindow.xib/en'' in Interface Builder, the size of ''Window (UIWindow)'' is grey and uneditable, but the size of its parent ''View (EAGLView)'' is editable - but has no affect on the window Sad (The app was based on GLSprite if that's any help.)
Quote this message in a reply
Member
Posts: 269
Joined: 2005.04
Post: #4
(Jul 26, 2010 08:54 AM)the_wandering_monster Wrote:  Heya ThemsAllTook! I've tried your suggestion but it doesn't seem to make any difference Sad To clarify, I'm not trying to build an app which can run both on the iPhone and on the iPad - I'm trying to port a project from the iPhone to the iPad.

If I open ''MainWindow.xib/en'' in Interface Builder, the size of ''Window (UIWindow)'' is grey and uneditable, but the size of its parent ''View (EAGLView)'' is editable - but has no affect on the window Sad (The app was based on GLSprite if that's any help.)

I forget how to fix this inside Interface Builder, but you can fix it in code.

In applicationDidFinishLaunching: in your app delegate you can add:

Code:
CGRect  rect = [[UIScreen mainScreen] bounds];
[window setFrame:rect];

That'll set the size of the window to the size of your screen.
Quote this message in a reply
Member
Posts: 21
Joined: 2009.10
Post: #5
Heya Bachus, thanks! - that's had an effect, but not the effect I was looking for Annoyed Now instead of rendering into the top-left corner of the iPad with the rest of the screen black, it's rendering into the bottom-left corner of the iPad with the rest of the screen white Sad Gah...
Quote this message in a reply
Member
Posts: 73
Joined: 2009.03
Post: #6
I'm having the same problem. I noticed that the frame buffer size is returning the size of an iPhone instead of iPad. I am using OpenGL ES 1 (instead of 2) and don't want to convert it to 2 if I don't need to. What is causing the frame buffers to be created at 320x480?

glGenFramebuffersOES is used to create the buffers.
glGetRenderbufferParameterivOES is used to get the width and height of the buffers.

Thanks!

[Edit] This appears to be related to the xib file, which seems to be stuck at 320x480. I can't figure out how to change the size of it.
[Edit 2] I figured out how to change the window size in the xib. You have to open the window before the size inspector will allow you to change the values. I changed it to 768x1024 and it seems to work now.
Quote this message in a reply
Nibbie
Posts: 1
Joined: 2010.10
Post: #7
UIWindow resizing can be achieved with manual conversion of .xib files to iPad version using Interface Builder.
This is mentioned in iOS 4.0 Release Notes in Known Issues->Xcode section.

This do the trick for me.
Quote this message in a reply
Member
Posts: 81
Joined: 2007.07
Post: #8
Save yourself a lot of trouble, just create a new iPad OGLES app in xcode, everything will already be setup and working for you, drag your files in from your old xcode project into your new one, update the xib with the correct app delate and your done. I had to start a whole new project today and do this just to get the MF#*!!FS#$**! code signing to work.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Small size texture problem kendric 3 2,877 Mar 25, 2009 06:40 PM
Last Post: kendric