Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(void) makeDividerPanel: (BOOL) isPortrait
- {
- for (UIView *view in dividerPanel.subviews)
- {
- [view removeFromSuperview];
- }
- int leftShift = 0;
- [dividerPanel setFrame:CGRectMake(0, 0, upperPanel.frame.size.width, upperPanel.frame.size.height)];
- UIImage *dividerImage = [UIImage imageNamed:@"buttons-divider.png"];
- int btnCount = 0;
- UIView *divider = [[UIView alloc] initWithFrame:CGRectMake(leftShift + [self widthForButtonWithNumber:btnCount andOrientation:isPortrait] - 1, 0, 2, toolBarHeight)];
- [divider setBackgroundColor:[UIColor colorWithPatternImage:dividerImage]];
- [dividerPanel addSubview:divider];
- [divider release];
- leftShift += [self widthForButtonWithNumber:btnCount andOrientation:isPortrait] + 1;
- btnCount++;
- divider = [[UIView alloc] initWithFrame:CGRectMake(leftShift + [self widthForButtonWithNumber:btnCount andOrientation:isPortrait] - 1, 0, 2, toolBarHeight)];
- [divider setBackgroundColor:[UIColor colorWithPatternImage:dividerImage]];
- [dividerPanel addSubview:divider];
- [divider release];
- leftShift += [self widthForButtonWithNumber:btnCount andOrientation:isPortrait] + 1;
- btnCount++;
- divider = [[UIView alloc] initWithFrame:CGRectMake(leftShift + [self widthForButtonWithNumber:btnCount andOrientation:isPortrait] - 1, 0, 2, toolBarHeight)];
- [divider setBackgroundColor:[UIColor colorWithPatternImage:dividerImage]];
- [dividerPanel addSubview:divider];
- [divider release];
- leftShift += [self widthForButtonWithNumber:btnCount andOrientation:isPortrait] + 1;
- btnCount++;
- divider = [[UIView alloc] initWithFrame:CGRectMake(leftShift + [self widthForButtonWithNumber:btnCount andOrientation:isPortrait] - 1, 0, 2, toolBarHeight)];
- [divider setBackgroundColor:[UIColor colorWithPatternImage:dividerImage]];
- [dividerPanel addSubview:divider];
- [divider release];
- if (hasChords)
- {
- leftShift += [self widthForButtonWithNumber:btnCount andOrientation:isPortrait] + 1;
- btnCount++;
- divider = [[UIView alloc] initWithFrame:CGRectMake(leftShift + [self widthForButtonWithNumber:btnCount andOrientation:isPortrait] - 1, 0, 2, toolBarHeight)];
- [divider setBackgroundColor:[UIColor colorWithPatternImage:dividerImage]];
- [dividerPanel addSubview:divider];
- [divider release];
- }
- leftShift += [self widthForButtonWithNumber:btnCount andOrientation:isPortrait] + 1;
- btnCount++;
- divider = [[UIView alloc] initWithFrame:CGRectMake(leftShift + [self widthForButtonWithNumber:btnCount andOrientation:isPortrait] - 1, 0, 2, toolBarHeight)];
- [divider setBackgroundColor:[UIColor colorWithPatternImage:dividerImage]];
- [dividerPanel addSubview:divider];
- [divider release];
- }
Advertisement
Add Comment
Please, Sign In to add comment