Reputation: 3433
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
Reputation: 1237
You can rotate the progress bar to vertical by the below code:
progressView.transform= CGAffineTransformMakeRotation( M_PI * 0.5 );
Upvotes: 5
Reputation: 2076
you have to set the property of size in IB then is't work fine see in below image
this work for both orientations
Upvotes: 0
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