Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)willPresentActionSheet:(UIActionSheet *)actionSheet {
- [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:YES];
- inShop = YES;
- int i = 0;
- for (UIButton *view in actionSheet.subviews)
- {
- if (i == 1)
- {
- CGRect cropRect = CGRectMake(20*4, 0, 20, 20);
- CGImageRef imageRefA = [UIImage imageWithData:[NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"small_icons" ofType:@"png"]]].CGImage;
- CGImageRef imageRef = CGImageCreateWithImageInRect(imageRefA, cropRect);
- UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageWithCGImage:imageRef]];
- CGRect frame = [view frame];
- frame.size.width = 20;
- frame.size.height = 20;
- frame.origin.y = frame.origin.y + 12;
- frame.origin.x += 4;
- [imgView setFrame:frame];
- [actionSheet addSubview: imgView];
- //CGImageRelease(imageRefA);
- CGImageRelease(imageRef);
- [imgView release];
- }
- if (i == 2)
- {
- CGRect cropRect = CGRectMake(20*1, 0, 20, 20);
- CGImageRef imageRefA = [UIImage imageWithData:[NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"small_icons" ofType:@"png"]]].CGImage;
- CGImageRef imageRef = CGImageCreateWithImageInRect(imageRefA, cropRect);
- UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageWithCGImage:imageRef]];
- CGRect frame = [view frame];
- frame.size.width = 20;
- frame.size.height = 20;
- frame.origin.y = frame.origin.y + 12;
- frame.origin.x += 4;
- [imgView setFrame:frame];
- //CGImageRelease(imageRefA);
- CGImageRelease(imageRef);
- [actionSheet addSubview: imgView];
- [imgView release];
- }
- if (i == 3)
- {
- CGRect cropRect = CGRectMake(20*3, 0, 20, 20);
- CGImageRef imageRefA = [UIImage imageWithData:[NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"small_icons" ofType:@"png"]]].CGImage;
- CGImageRef imageRef = CGImageCreateWithImageInRect(imageRefA, cropRect);
- UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageWithCGImage:imageRef]];
- CGRect frame = [view frame];
- frame.size.width = 20;
- frame.size.height = 20;
- frame.origin.y = frame.origin.y + 12;
- frame.origin.x += 4;
- [imgView setFrame:frame];
- //CGImageRelease(imageRefA);
- CGImageRelease(imageRef);
- [actionSheet addSubview: imgView];
- [imgView release];
- }
- i++;
- }
- }
Add Comment
Please, Sign In to add comment