// 旋转按钮
UIActivityIndicatorView *alert = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(100, 200, 100, 100)];
[alert setColor:[UIColor grayColor]];
[_window addSubview:alert];
[alert startAnimating];
[alert release];
- (void)startAnimating;
- (void)stopAnimating;
- (BOOL)isAnimating;
效果图:
//下弹选择框
UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"标题" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"buttt" otherButtonTitles:@"button2",@"button3", nil];
[sheet showInView:_window];
[sheet release];
效果图:
//左右选择框
UISegmentedControl *seg = [[UISegmentedControl alloc] initWithItems:@[@"aaa", @"aaa"]];
[seg setFrame:CGRectMake(50, 100, 100, 30)];
[_window addSubview:seg];
[seg release];
//滑动选择框
UISwitch *sw = [[UISwitch alloc] initWithFrame:CGRectMake(50, 150, 50, 30)];
[_window addSubview:sw];
[sw release];
//工具条
UIToolbar *too = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 528, 320, 40)];
[too setBackgroundColor:[UIColor grayColor]];
[_window addSubview:too];
[too release];