ios: fix offset for 'details' table header in iphone game configuration
authorkoda
Wed, 28 Mar 2012 01:26:47 +0200
changeset 6831 f848120b3fcc
parent 6830 d2df090453aa
child 6832 fae8fd118da9
ios: fix offset for 'details' table header in iphone game configuration
project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m
--- a/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m	Wed Mar 28 01:19:36 2012 +0200
+++ b/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m	Wed Mar 28 01:26:47 2012 +0200
@@ -100,7 +100,11 @@
 -(void) viewDidLoad {
     self.sectionsHidden = NO;
 
-    UITableView *aTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 45, self.view.frame.size.width, self.view.frame.size.height-48)
+    NSInteger verticalOffset = IS_IPAD() ? 45 : 0;
+    UITableView *aTableView = [[UITableView alloc] initWithFrame:CGRectMake(0,
+                                                                            verticalOffset,
+                                                                            self.view.frame.size.width,
+                                                                            self.view.frame.size.height - verticalOffset)
                                                            style:UITableViewStyleGrouped];
     aTableView.delegate = self;
     aTableView.dataSource = self;
@@ -221,7 +225,7 @@
 }
 
 -(CGFloat) tableView:(UITableView *)aTableView heightForHeaderInSection:(NSInteger)section {
-    return IS_IPAD() ? 50.0 : 0;
+    return IS_IPAD() ? 0 : 50;
 }
 
 -(UIView *)tableView:(UITableView *)aTableView viewForHeaderInSection:(NSInteger)section {