Is it possible to target both iphone & ipad using the same project? - iphone

The subject is self explanatory, I have a current iPhone project using Monotouch/MonoDevelop and I want to be able to target iPad too.
Is there any way that the application could do a "stretch"? I have not tested the app in an ipad, only in the emulator and it does not look good.
Thank,
Ignacio

Yes, you can. You can either programmatically check if app is running on ipad or on iphone and set different nib files for each mode.
Also you may use the same views either created programmatically or through Interface Builder, but in that case you should set your resizing masks properly.

Related

how to convert ipad version app to iphone version?

Now I need to redesign an app(iPad version), it can run on iPad successfully .The targeted device family is iPad, and I want it run on iPhone.So I already changed the targeted family to iPhone, but it cannot run. It is because the size of the iPad and iPhone is different, so how can i make it successful to run on iPhone? Do I need to create a new xib for iPhone?How to achieve it?
Yes, you need to create new XIB's that are structured for the smaller interface. You will also need to determine in code what view you are loading for which device.
if ( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad )
/* do something for the iPad */
else
/* do something for the iPhone */
Yes, you will need to create new /xibs for iPhone, an iPad App won't work on an iPhone like that. Not only the sizes are diferent, the ratio width/height is different too
If you really worked at it, you could use the xib file for both the iPad and iPhone. But first you have to make sure that your existing xib files don't have a "~ipad" in them, because if they do, they will only be loaded on the iPad and not the iPhone.
You may also want to make your app Universal instead of two separate iPhone and iPad apps.
And if you use a SplitViewController, you will have to add separate code for the iPhone. Same thing with UIPopovers.
Absolutely you have to redesign all UI corresponding to device screen size. You can create new xib or Storyboard separately for iPhone, So that you can achieve it.
You may use UIPopoverController in iPad but it won't work in iPhone, you have to present that viewcontroller in iPhone. From that you can manage that.,
its so simple you have to change the xib file and other code will be same
You can create xib from
New File -> user interface => view

convert an ipad app to iphone app with custom views

This might be a repeat question.But i have a problem. I have an iPad app functional. The app is built in iOS 6. When i started building it i chose iPad as targeted device NOT universal. Now my client has asked for an iPhone version of it.In my iPad app i keep adding custom views as the client clicks "Add More".I add a custom view which is bunch of textfields, buttons etc.So i copied my iPad app and changed the Targeted device family to iPhone once and also Universal next time and tested it. So when i launch the app in iPhone configuration (keeping the targeted device family as Universal) my view controller stays like that on iPad. I cannot scroll the app also(not up/down..nor sideways). Is this the correct way to convert iPad app to iPhone app . Also everything is still with scale to iPad. Should i start a new project and start everything from scratch.Set the storyboard to fit according to iPhone configuration? In my research people said just change the targeted device family to Universal. But it doesn't work. Please let me know if you need more information. Thanks.
It is possible to convert the current project you have to an app that can be used universally, but it would take more time than simply just creating a new project that allows universal usage, and adding in the files of which you used for your iPad project.
Hint: You can use more than one storyboard when the project was created universally. It will automatically set this up for you.
I would also advise that you separate your files into what works universally, and what is specific for the iPhone or the iPad.
Happy Coding!
After many search i found that it possible to have an application for both Iphone and ipad devices.but in your code you should define unique ui for each device(two xib file).

Convert iPad app using Storyboard into iPhone app

I have one view which was created for iPad, using a Storyboard.
Now, I want to convert it to an iPhone app.
I am very new to Storyboards. Until now, I have been using separate XIB files.
Can you please explain to me the steps for doing this?
What you want to do is important, if you want your app to just run on both iphone and ipad, you can go to project Summary and then in devices select "Universal" option. This will just run your app in both iphone and ipad(full screen and not 2x). But if you want to look it better then you have to manage your UI assets accordingly.

Convert simple iPhone app to Universal app

I have very simple iPhone app, which uses just UIButtons, UIlabels, UITableView. without any custom controllers and graphics. How can I convert app to universal with that UI?
First update the application target device to Universal.
Update the application target device to Universal.
Check the Info.plist for NSMainNibFile & NSMainNibFile~ipad keys.
For all other views, have two different NIB. For example FirstView.xib & FirstView~ipad.xib. iOS runtime will load the proper view based on the device.
Here is a screenshot of a sample project:
I needed to convert my iPhone App to iPad yesterday and found the easiest way to do it as long as your app is pretty simple. Mine was literally just some tableViews that were set to auto-size. In Targets / Devices just change it from 'iPhone' to 'Universal' and then build your application. This worked very nicely for me. All tableViews were perfectly formatted for the iPad and that is really all I needed.
Note that if you had any other XIB files that were not just tableViews, such as a window with text fields, all you have to do is set them each to resize properly so they stretch and stay at the top and your simple app should be pretty much all set for the iPad.
Obviously you'll need to test it and tweak anything needed but for the most part the above worked magically for me and took literally one second to convert my iPhone app to an iPad app!

iphone app only showing in little window on ipad

I have developped an iPhone app and I now need it to work on iPad. On the simulator the app only show in a little window (the x2 zoom enable the app to work in full screen) but is there a way to have the app directly showing in full screen ?
Thanks a lot,
Luc
go to project settings and set Targeted Device Family to iPhone/iPad
As Max said, go to project setting and set Target Device Family to iPhone/iPad. But this is not enough. With this change the application type will be universal application. This is good, because the app will start in full screen, but if you hard coded the dimensions of the views in the application then the look and feel on the iPad will be bad. So do the first step what Max suggested for you and then check if the app looks like you want, because it will not arrange the views automatically. You should do the changes from code or from nibs.
There is a little help if you set properly the autoresizing masks.
Edit:
Project menu -> Edit Project settings -> Targeted device family
You will need to do at least the following:
Change the Targeted Device Family to include the iPad.
Create or convert all needed .xibs for the iPad (using the Interface Builder Menu).
Reference the top level iPad .xib from your app's info.plist (using the NSMainNibFile~ipad key).
Handle the iPad paradigm wherever the controller or view source code needs to differ.