project_files/HedgewarsMobile/Classes/TeamConfigViewController.m
changeset 6108 7a8da11a6144
parent 6107 0741c0f0203e
child 6115 485cfecadc9a
equal deleted inserted replaced
6107:0741c0f0203e 6108:7a8da11a6144
    18  * File created on 20/04/2010.
    18  * File created on 20/04/2010.
    19  */
    19  */
    20 
    20 
    21 
    21 
    22 #import "TeamConfigViewController.h"
    22 #import "TeamConfigViewController.h"
       
    23 #import <QuartzCore/QuartzCore.h>
    23 #import "SquareButtonView.h"
    24 #import "SquareButtonView.h"
    24 
    25 
    25 
    26 
    26 @implementation TeamConfigViewController
    27 @implementation TeamConfigViewController
    27 @synthesize listOfTeams, listOfSelectedTeams, cachedContentsOfDir;
    28 @synthesize listOfTeams, listOfSelectedTeams, cachedContentsOfDir;
    32     [super viewDidLoad];
    33     [super viewDidLoad];
    33 
    34 
    34     CGSize screenSize = [[UIScreen mainScreen] bounds].size;
    35     CGSize screenSize = [[UIScreen mainScreen] bounds].size;
    35     self.view.frame = CGRectMake(0, 0, screenSize.height, screenSize.width - 44);
    36     self.view.frame = CGRectMake(0, 0, screenSize.height, screenSize.width - 44);
    36 
    37 
    37     if ([self.tableView respondsToSelector:@selector(setBackgroundView:)]) {
    38     if (IS_IPAD()) {
    38         if (IS_IPAD())
    39         [self.tableView setBackgroundColorForAnyTable:[UIColor darkBlueColorTransparent]];
    39             [self.tableView setBackgroundView:nil];
    40         self.tableView.layer.borderColor = [[UIColor darkYellowColor] CGColor];
    40         else {
    41         self.tableView.layer.borderWidth = 2.7f;
    41             UIImage *backgroundImage = [[UIImage alloc] initWithContentsOfFile:@"background~iphone.png"];
    42         self.tableView.layer.cornerRadius = 8;
    42             UIImageView *background = [[UIImageView alloc] initWithImage:backgroundImage];
    43         self.tableView.contentInset = UIEdgeInsetsMake(10, 0, 10, 0);
    43             [backgroundImage release];
    44     } else {
    44             [self.tableView setBackgroundView:background];
    45         UIImage *backgroundImage = [[UIImage alloc] initWithContentsOfFile:@"background~iphone.png"];
    45             [background release];
    46         UIImageView *background = [[UIImageView alloc] initWithImage:backgroundImage];
    46         }
    47         [backgroundImage release];
    47     } else
    48         [self.tableView setBackgroundView:background];
    48         self.view.backgroundColor = [UIColor blackColor];
    49         [background release];
    49 
    50     }
    50     self.tableView.separatorColor = [UIColor darkYellowColor];
    51 
       
    52     self.tableView.indicatorStyle = UIScrollViewIndicatorStyleWhite;
       
    53     self.tableView.separatorColor = [UIColor whiteColor];
    51     self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    54     self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    52 }
    55 }
    53 
    56 
    54 -(void) viewWillAppear:(BOOL)animated {
    57 -(void) viewWillAppear:(BOOL)animated {
    55     [super viewWillAppear:animated];
    58     [super viewWillAppear:animated];
   198 
   201 
   199     return cell;
   202     return cell;
   200 }
   203 }
   201 
   204 
   202 -(CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
   205 -(CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
   203     return 40.0;
   206     return 45.0;
   204 }
   207 }
   205 
   208 
   206 -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
   209 -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
   207     CGRect frame = CGRectMake(0, 0, self.view.frame.size.width * 80/100, 30);
   210     CGRect frame = CGRectMake(0, 0, self.view.frame.size.width * 80/100, 30);
   208     NSString *text = (section == 0) ? NSLocalizedString(@"Playing Teams",@"") : NSLocalizedString(@"Available Teams",@"");
   211     NSString *text = (section == 0) ? NSLocalizedString(@"Playing Teams",@"") : NSLocalizedString(@"Available Teams",@"");