2

I've seen examples of overlay views in different iPhone apps (Skype, Phone.app (while making a call), Google Mobile) and I was wondering how I could do the same in an app.

I'm making an app which has a record button in it and when that button is pressed, I want a nice looking overlay (similar to the overlay view that appears when making a call on the iPhone) that says "Recording" with a count in seconds to appear along with a stop button.

Is there any guide or anything I can look at to help me do this? Thanks.

Also I was wondering how I can make a vertically long view that requires the user to scroll with their finger that isn't a TableView. Also thanks.

Anthony Glyadchenko
  • 3,572
  • 7
  • 48
  • 66

2 Answers2

4

I usually just create them myself; it's just a UIView which you insert above your other subviews.

UIView *overlayView = [[UIView alloc] initWithFrame:self.view.frame];
overlayView.backgroundColor = [UIColor blackColor];
overlayView.alpha = 0.4;
[self.view addSubview:overlayView];
[overlayView release];

As for your second question check out UIScrollView's.

peterp
  • 3,145
  • 1
  • 20
  • 24
  • 1
    If you're in a tab bar application, you could also do this to add it as a subview: `[[[UIApplication sharedApplication] keyWindow] addSubview:overlayView];` – Emil Feb 12 '10 at 21:59
1

For scrolling you need a UIScrollView. Look at the class reference for examples on how to use it.

For my overlays I push a new modal view which I make transparent.

willcodejavaforfood
  • 43,223
  • 17
  • 81
  • 111