2

i have a UIViewController that is only about 260px tall(or at least the area i want viewable is 260 approx. height) and really just has a picker on it and a done button. I'm calling presentModalViewController to display it but its showing the whole view, when really i only want to show the picker and the done button bar above the picker, not the black above the bar , is there a way to show only this and not the whole view behind the picker when it is presented ?

alt text http://img202.imageshack.us/img202/1754/picker.jpg

not too much for code here, ....

UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:tipPickerController];

[self presentModalViewController:navigationController animated:YES];

let me know if i should post more code to get help, thanks

slim
  • 4,010
  • 9
  • 35
  • 42

2 Answers2

0

Direct answer to your question:
You don't have to use a full screen view (320 X 480). You might set the view for the exact size that you need (without the black part on the top).

My suggestion:
Set the view for full screen, but in addition set a transparent color for your top level view (instead of black).
This way the original view won't be interactive while the picker is visible...

Michael Kessler
  • 14,245
  • 13
  • 50
  • 64
0

I am on a quest for the same thing. I found these resources.

How to make a UIPickerView slide half way up the screen?

Add UIPickerView & a Button in Action sheet - How?

The short answer is that a modal view controller is not what you want to use for this. It will work on an iPad but on an iPhone/iPod the modal view controller kills the first view when you display it. That is why it is black. I dont have it working yet but I think these resources are just the think to help.

Hope it helps.

Community
  • 1
  • 1
RachelD
  • 4,072
  • 9
  • 40
  • 68