project_files/HedgewarsMobile/Classes/AboutViewController.m
changeset 4460 bdace1e2f8aa
parent 4115 222b8016c773
child 4603 d362ab6c7f53
equal deleted inserted replaced
4459:6de30ddc184e 4460:bdace1e2f8aa
    89 #pragma mark Table view delegate
    89 #pragma mark Table view delegate
    90 -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    90 -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    91     // do nothing
    91     // do nothing
    92 }
    92 }
    93 
    93 
       
    94 -(CGFloat) tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
       
    95     return 95;
       
    96 }
       
    97 
       
    98 -(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger) section {
       
    99     NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
       
   100     char *fullver;
       
   101     short int proto = 20;
       
   102     HW_versionInfo(&proto, &fullver);
       
   103 
       
   104     NSString *footerString = [[NSString alloc] initWithFormat:
       
   105                               @"You are running Hedgewars-iOS %@ based on Hedgewars version %s (protocol %d)",
       
   106                               version, fullver, proto];
       
   107 
       
   108     UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 50)];
       
   109     footer.backgroundColor = [UIColor clearColor];
       
   110 
       
   111     UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width*80/100, 90)];
       
   112     label.center = CGPointMake(self.tableView.frame.size.width/2, 45);
       
   113     label.textAlignment = UITextAlignmentCenter;
       
   114     label.font = [UIFont systemFontOfSize:16];
       
   115     label.textColor = [UIColor lightGrayColor];
       
   116     label.numberOfLines = 5;
       
   117     label.text = footerString;
       
   118 
       
   119     label.backgroundColor = [UIColor clearColor];
       
   120     [footer addSubview:label];
       
   121     [label release];
       
   122     return [footer autorelease];
       
   123 }
       
   124 
    94 #pragma mark -
   125 #pragma mark -
    95 #pragma mark Memory Management
   126 #pragma mark Memory Management
    96 -(void) didReceiveMemoryWarning {
   127 -(void) didReceiveMemoryWarning {
    97     self.people = nil;
   128     self.people = nil;
    98     [super didReceiveMemoryWarning];
   129     [super didReceiveMemoryWarning];