views:

1097

answers:

4

EDIT: I had set the overlay view to 460px high, not 480.

New question:

How do you remove a subview loaded to another window/view?

+1  A: 

You are responsible for setting viewWithPicker's frame or center property correctly so that it will appear at the correct position.

Ole Begemann
Okay, so I fixed it.Do you know how to remove the subview again?
Emil
`[viewWithPicker removeFromSuperview];`
Ole Begemann
A: 

Did you in Interface Builder configure it to leave space at the bottom for a ToolBar or otherwise set the size to anything that would make it smaller than the full size (480 x 320px)?

If you are adding it as a subview to a ViewController that is using a ToolBar you might want to check this question for more information.

willcodejavaforfood
A: 

The key window takes up the full screen size (320 x 480), however, the status bar is drawn above the key window at all times.

When you add a subview to the key window without settings its frame or centre manually, its origin will be placed at (0,0), which the status bar is drawn on top.

The space you're seeing at the bottom of the view is because your view likely has its height set to 460, which happens if the view was created in Interface Builder and has the "simulated interface elements" set to show the status bar.

You'll need to change the subview's y value to position it below the status bar. 20 is usually a good value to use, since that's the status bar's height. However, the status bar height may change in future versions of the iPhone OS, so hardcoding values like that is a bad idea.

Jasarien
A: 

I fixed it !

As simple as setting the overlay view to 480px heigth.

Does anybody know how to get it away again? The subview.

Emil