Skip to content

Commit

Permalink
Merge pull request #3002 from vishalduggal/timob-10998
Browse files Browse the repository at this point in the history
[TIMOB-10998] IOS6 now has a default bg view when style grouped
  • Loading branch information
srahim committed Sep 20, 2012
2 parents 33b6118 + dc184c3 commit 249cdb1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion iphone/Classes/TiUITableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ -(void)setBackgroundColor:(TiColor*)color onTable:(UITableView*)table

// WORKAROUND FOR APPLE BUG: 4.2 and lower don't like setting background color for grouped table views on iPad.
// So, we check the table style and device, and if they match up wrong, we replace the background view with our own.
if ([table style] == UITableViewStyleGrouped && [TiUtils isIPad]) {
if ([table style] == UITableViewStyleGrouped && ([TiUtils isIPad] || [TiUtils isIOS6OrGreater])) {
UIView* bgView = [[[UIView alloc] initWithFrame:[table frame]] autorelease];
[table setBackgroundView:bgView];
}
Expand Down
6 changes: 6 additions & 0 deletions iphone/Classes/TiUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,12 @@ typedef enum {
*/
+(BOOL)isIOS5OrGreater;

/**
Whether or not the current OS version is equal to or greater than 6.0.
@return _YES_ if the current OS version is equal to or greater thann 6.0, _NO_ otherwise.
*/
+(BOOL)isIOS6OrGreater;

/**
Whether or not the current device is an iPhone 4.
@return _YES_ if the current device is an iPhone 4, _NO_ otherwise.
Expand Down
5 changes: 5 additions & 0 deletions iphone/Classes/TiUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ +(BOOL)isIOS5OrGreater
return [UIAlertView instancesRespondToSelector:@selector(alertViewStyle)];
}

+(BOOL)isIOS6OrGreater
{
return [UIViewController instancesRespondToSelector:@selector(shouldAutomaticallyForwardRotationMethods)];
}

+(BOOL)isIPad
{
return [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad;
Expand Down

0 comments on commit 249cdb1

Please sign in to comment.