1

I'm searching for the old style of the UIProgressView:

alt text http://img.skitch.com/20090620-dagnbt6eh2s884nfkbkqgne1re.jpg

The only UIProgressViewStyle, I'm able to present is this:

alt text http://img.skitch.com/20090620-ewujnw3r62qnb91qpbdh8iktne.jpg

Is the old one still available? Setting the property UIProgressViewStyle always leads to the blue UIProgressView.

Stefan
  • 28,843
  • 15
  • 64
  • 76
  • i was never aware that this old style was available.. what sdk version are you using ... and what were you using when you last saw the old version?? – zpesk Jun 20 '09 at 14:18
  • I've never used the old style. I saw it in Erica Sadun's iPhone book. The provided an example, which was set to SDK 2.0. – Stefan Jun 20 '09 at 14:28
  • i know erica sadun's book has a section on un-published api's - are you sure it wasn't in this section?? – zpesk Jun 20 '09 at 16:10
  • Yepp, it's in chapter four. The code uses standard Apple documented code. I think Apple simply have replaced the graphics after 2.0 :-( – Stefan Jun 20 '09 at 16:27

4 Answers4

6

For what it'a worth, another way of accessing the old-style progress bar is to create a UIProgressView control in the usual way. As of iOS 4.1, you can get the old appearance by setting the progress view's style to the undocumented value of 100.

This avoids using an undocumented class, or even calling undocumented methods. However, I'm sure Apple still won't approve.. ;-)

Dave

Dave Jewell
  • 116
  • 1
  • 1
  • 1
    Oh - and if you do use this undocumented style to change the style of a UIProgressView loaded from a nib, then you should call 'sizeToFit' after setting the style. This is 'cos the old style is twice the height of the newer blue progress bar. – Dave Jewell Oct 08 '10 at 18:42
  • For information, that style doesnt work anymore properly on iOS5. – Vincent Guerci Feb 13 '12 at 15:28
  • i think there is very little use for answers that provides code that won't be accepted by app store.. – abbood Jul 22 '13 at 06:25
4

I think there are two styles for the UIProgressView. The default which is referenced as UIProgressViewStyleDefault, and the one you are referring to is called UIProgressViewStyleBar.

those are set as the following yourUIProgressView.ProgressViewStyle = UIProgressViewStyleBar;

or

set nothing for the default.

2

She wrote her book when the SDK was still NDA and before it used IB. Many, many changes occurred after that time.

Corey Floyd
  • 25,929
  • 31
  • 126
  • 154
2

It's UIProgressBar, a private subclass of UIProgressView.

You can use it in this way, but Apple might reject your app:

[[NSClassFromString(@"UIProgressBar") alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 100.0f, 90.0f)];
digdog
  • 4,198
  • 1
  • 26
  • 23