IOS basics-UIProgressView

Source: Internet
Author: User

IOS basics-UIProgressView

UIProgressView and UIActivityIndicator are similar.

 

But the difference is that,

UIProgressView can reflect the progress more accurately

UIActivityIndicator indicates that the transaction is in progress.

 

In the Mail program, when downloading information, a UIProgressView is displayed at the bottom.

 

-(Void) viewDidLoad {[super viewDidLoad]; // define a progress bar UIProgressView * progressV = [[UIProgressView alloc] init]; progressV. frame = CGRectMake (100,100, 2,300); // progress value progressV. progress = 0.1;/* typedef NS_ENUM (NSInteger, UIProgressViewStyle) {UIProgressViewStyleDefault, // default state UIProgressViewStyleBar, // generally used for toolbar}; */progressV. progressViewStyle = UIProgressViewStyleDefault; // set the color of the filled part (assuming that the progress is 30%, the color of 30% is this attribute) progressV. progressTintColor = [UIColor greenColor]; // set the color of the unfilled part (assuming that the Progress reaches 30%, the color of 70% is this attribute) progressV. trackTintColor = [UIColor redColor]; // sets the filling part of the image. After setting the image, progressTintColor is invalid progressV. progressImage = [UIImage imageNamed: @ "1"]; // The trackTintColor is invalid after the image is set for the unspecified part. trackImage = [UIImage imageNamed: @ "2"]; [self. view addSubview: progressV];} // The current progress value of the key SS attribute, and whether to set the animation-(void) setProgress :( float) aniss animated :( BOOL) animated {}


 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.