Mahesh Babu
Mahesh Babu

Reputation: 3433

How to create progress bar programmatically?

I created a view with a progress bar with an IBOutlet. Whenever I rotate the view to landscape mode, it is not rotated. So, I need to create the progress bar programmatically.

How can I do this?

Upvotes: 1

Views: 13315

Answers (3)

Stella
Stella

Reputation: 1237

You can rotate the progress bar to vertical by the below code:

progressView.transform= CGAffineTransformMakeRotation( M_PI * 0.5 );

Upvotes: 5

priyanka
priyanka

Reputation: 2076

you have to set the property of size in IB then is't work fine see in below imagealt text

this work for both orientations

Upvotes: 0

Brad The App Guy
Brad The App Guy

Reputation: 16275

UIProgressView *progressView = [[UIProgressView alloc] init];
progressView.frame = CGRectMake(100,100,100,20);
[self.view addSubview:progressView];

Should get you started.

I would read up on views and view controllers in Apple's documentation. The View Programming Guide for iPhone OS goes into quite a bit of detail for what you want to do. If you have not read the iPhone Application Programming Guide and the iPhone Development Guide I would do so first.

All of these documents are available on developer.apple.com, and also in the help system of Xcode.

Upvotes: 11

Related Questions