Uiactivityindicatorview instances provide a lightweight view that displays a standard rotation progress wheel. When using these views, one of the most important keywords is small. 20x20 pixels are the size of most of the indicator styles for the clearest display. As long as it is slightly larger, the indicator will become blurred.
The iphone offers several different styles of Uiactivityindicatorview classes. Uiactivityindicator-viewstylewhite and Uiactivityindicatorviewstylegray are the most concise. The black background is best for the white version, and the white background is best for the gray look (4-7). It's very skinny and has a sharp style. Be careful when choosing white or gray. All white displays no content on a white background. Uiactivityindicatorviewstylewhitelarge can only be used for dark backgrounds. It provides the largest and clearest indicator.
The following code implements the start and stop of the progress wheel:
-(void) viewdidload
{
activity = [[[Uiactivityindicatorviewalloc] initwithframe:cgrectmake (0, 0, 30, 30)];//Specify the size of the progress wheel
[Activitysetcenter:cgpointmake (160, 140)];//Specify Progress Wheel center point
[activitysetactivityindicatorviewstyle:uiactivityindicatorviewstylewhitelarge];//Set Progress wheel Display type
[Self.viewaddSubview:activity];
[Superviewdidload];
}
button to click on the method that was triggered. Starts or closes the progress wheel.
-(Ibaction) Startorstop: (ID) sender{
if ([activityisanimating]) {
[Activitystopanimating];
}
Else
[Activitystartanimating];
}
Click Start Progress Wheel
Click here to stop the progress wheel
iOS------Progress Wheel