iPhone view won't scale to fit iPad screen - iphone

I'm having a bit of trouble with, as silly as all things, a progress view overlay.
I've created a subclass of UIViewController with a XIB with a black 50% opaque background and an activity indicator in the middle of it, I can get it to appeaer and disappear when my remote data class tries to get data from the remote server etc.
It works fine on the iPhone, scales and rotates.
However, when I fire it up in iPad simulator or on device, the square only fills the upper left corner of the screen and won't resize to to fit the display.
But, all my other views are created in the same way, including all the tableview's that this will sit over.
My app initialises a table view with a single cell that says "Loading..." and then calls the remote data services class which then does the following:
progress = [[ProgressActivityViewController alloc] initWithNibName:#"ProgressActivityViewController" bundle:nil];
UIViewController *dlg = (UIViewController *)self.delegate;
[dlg.view addSubview:progress.view];
NB: progress is set up in the .h file as ProgressActivityViewController)
It's the remote data services class that is adding and removing the subview, when you init the RemoteData class, you pass it 'self' as the delegate so it can talk to it through a protocol.
I know this needs some other type checking with 'isKindOfClass' etc which I can add in later but I need to get the simple view to stretch to full screen.
This code does work and puts the view on the screen but it just doesn't fill the screen on the iPad
The source for the activity indicator example i've used is at this link:
http://tapadoo.com/2009/iphone-how-to-do-full-screen-activity-status/

Do you have an iPad paradigm .xib in your project, and also listed that iPad xib file in your app's plist? If not, you may only get a window in the top left corner.
Create a new Universal iPhone/iPad project, and the template will show you where to mention the iPad xib in the plist.

Related

Size of UIView object in Interface Builder changes when using the app

I have an extra UIView object that I just dragged onto the storyboard. It covers the entire iPhone screen. So I clicked on it and dragged it until it only covered half of the iPhone screen.
This is what my storyboard looks like with my extra UIView object selected:
However, when I actually use the app on my iPhone, the UIView is much smaller and doesn't even take up half of the screen(It's the square with the stackoverflow site image inside of it):
How can I keep it from being smaller when I actually run the app? When running the app, I want the UIView object to be the same size as it is on the storyboard in xcode.
Thanks for the help.
You must have selected Autolayout. Uncheck it and problem is resolved.

creating instruction screen in iOS

I often time see in an iOS apps when you first launch the app there will be a one time instruction with arrows and such to show a first time user guide. It's usually a black transparant colored screen with arrows. I was trying to find a few app that does this, but I couldn't. Was wondering if someone knew the terms for these and how to create it?
Create a UIView and place it above the view you're wishing to guide the user through. Set up the UIView as a IBOutlet in your classes header file, set the background to black and set the alpha to 0.3 or something similar (test to see how it looks).
In header:
IBOutlet UIView *overlayView;
In main:
overlayView.alpha = 0.3f;
You may want to make sure that the overlay shows the first time the users opens the app or maybe store a value in a database for when the user dismisses the screen so that you don't show it again. To do this you can hide the UIView or simply set the alpha to 0.
Then simply add images or annotations to the UIView. As "bentford" said it's quite broad but this should get you on your way. You can also use multiple UIView's or even transformations to animate the screens.
I use Skitch. You can find it in the Mac App Store.
Skitch can take the screenshot in the simulator and overlay the arrows and notes. Then when you launch the app, you show the image created with Skitch in a UIImageView on top of the actual view. Then just hide the UIImageView.

Whats the approach to create a view similar to the one at apple app store

I wanted to know how can we design the view controller such that.., the upper half of the screen remains fixed and the below part of the screen can be navigated through.. !!
Should we use slipScreenController here ?
Your description sounds nothing like the Appstore app but the Appstore app simply has one vertical UIScrollView and another horizontal UIScrollView inside that for images.
If you are referring to browsing categories in AppStore then:
That is a tableView implemented in such way that it doesn't take the whole screen area. You need to create a UIViewController (not UITableViewController) and than add a tableView to the view (using Interface Builder or code). That way you can change the size and position of the tableView and use the remaining area of the view for something else, for example a UISegmentedControl above the tableView.
If you are reffering to reading description and images of single app then I think that UIScrollView is used for displaying images, not sure about the rest.

In a Tab Bar based app a controller release data of the other ! !

I've made a ViewBased app, in the app delegate i've set a UITabBarCotntroller, in the app i have different view Controller two of them displays text in a UITextView and labels, the other one is my "ShakeController" a UIViewController in which i've set a UIAcelerometerDelegate, in it i create a instance of UIAccelerometer, in the method which manages the shake everything works fine, in this controller i have also set a UIImageView to make a simple animation, in the view Did Load method i set my imageView.animation to an array of UIImage.
My problem is : when the app is launched i use the ViewControllers and everything work fine, but when i tap the ShakeController item in the tab bar and then when i come back to the other controllers the label looks like : label and textView like : Lorem ipsum..... the text of UItextView in IB.
I have noticed thaht if i comment the initialisation of my imageView to the array of image i can navigate the items (from a view controller to another) without the label change and stay what i want them to be.
Notice that the two controllers are in a UINavigationController.
(i use #proprety (nonnatomic, retain) then #synthesize ... then releqse in the dealloc for the labels textview and my uiimageView)
Do not know what to do thanks to all
Quite hard to understand what you're asking here... I re-read it three times and I'm still not sure!
Since you find the problem (the data in the other view being "released") goes away when you comment out your imageView animation initialisation, I would conclude that you are using up a large amount of the iPhone's memory which means that it is automatically unloading any un-seen view controllers. It will do this quite quickly to preserve memory.
You don't say how many images are in your animation, but just 10 medium-large images can be enough to trigger memory issues; if you are wanting to use 20/30+ you have to look for another way.
You can try just loading a few frames into your image first and then swapping them out on a recurring timer. But if it's anything more than very basic animation you'll need to get stuck in to core animation instead: http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/CoreAnimation_guide/Articles/WhatisCoreAnimation.html#//apple_ref/doc/uid/TP40004689

Customized Camera Toolbar on iPhone

I've created a camera application for iPhone and now I sit and polish the last of it. My application is a collage application where the user can take multiple pictures in a row.
As it is today I have a customized camera view that contains one UIButton for taking the pictures and one UIButton for getting back to the main view.
The problem is that my application is design for landscape mode and the camera control can only show in portrait mode. This makes the design of the GUI a little bit tricky and I now want to move away from having the buttons in the view to having the placed in a toolbar. When you initialize the camera you can set a bunch of different parameters and one of them is UIImagePickerController.toolbarHidden. If I set the value to NO it will show an empty toolbar and my question here is, how do I add items to this toolbar?
I've tried different solutions without any luck.
Thanks,
drisse
Does the standard UIViewController method -setToolBarItems:animated: method not work?