self.view.backgroundColor = [UIColor whiteColor]; //UISegmentedControl 是iOS中的分段控件,事实上是多个button的组合视图,通过切换不同的segment(严格来说,点击不同的button),响应不同的操作. NSArray *titles = @[@"轻拍", @"长按",@"轻扫",@"平移"]; UISegmentedControl *segmentControl = [[UISegmentedControl alloc] initWithItems:titles]; // //设置默认选中的分段 segmentControl.selectedSegmentIndex = 0; segmentControl.frame = CGRectMake(10, 40, 300, 30); // //给segmentedControl加入响应事件 [segmentControl addTarget:self action:@selector(handleSegmentControl:) forControlEvents:UIControlEventValueChanged]; [self.view addSubview:segmentControl]; [segmentControl release]; UIView *view = [[UIView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)]; view.backgroundColor = [UIColor blackColor]; view.tag = 200; [self.view addSubview:view]; [view release];
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
本文转自mfrbuaa博客园博客,原文链接:http://www.cnblogs.com/mfrbuaa/p/5306994.html,如需转载请自行联系原作者