Skip to content

Commit

Permalink
[TIMOB-15939] iOS7: Workaround actionsheet rendering issue
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalduggal committed Dec 10, 2013
1 parent a913739 commit 5f30b38
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
11 changes: 6 additions & 5 deletions iphone/Classes/TiUIOptionDialogProxy.h
Expand Up @@ -11,14 +11,15 @@

@interface TiUIOptionDialogProxy : TiProxy<UIActionSheetDelegate> {

UIActionSheet *actionSheet;
UIActionSheet *actionSheet;
//We need to hold onto this information for whenever the status bar rotates.
TiViewProxy *dialogView;
CGRect dialogRect;
BOOL animated;
TiViewProxy *dialogView;
CGRect dialogRect;
BOOL animated;
NSUInteger accumulatedOrientationChanges;
BOOL showDialog;
BOOL showDialog;
BOOL persistentFlag;
BOOL forceOpaqueBackground;
}

@property(nonatomic,retain,readwrite) TiViewProxy *dialogView;
Expand Down
15 changes: 14 additions & 1 deletion iphone/Classes/TiUIOptionDialogProxy.m
Expand Up @@ -50,7 +50,7 @@ -(void)show:(id)args
}

persistentFlag = [TiUtils boolValue:[self valueForKey:@"persistent"] def:YES];

forceOpaqueBackground = [TiUtils boolValue:[self valueForKey:@"opaquebackground"] def:NO];

This comment has been minimized.

Copy link
@dawsontoth

dawsontoth Dec 12, 2015

Contributor

Shouldn't properties be camel cased? #blastfromthepast

if (actionSheet != nil) {
[actionSheet setDelegate:nil];
[actionSheet release];
Expand Down Expand Up @@ -141,6 +141,19 @@ -(void)suspended:(NSNotification*)note

#pragma mark AlertView Delegate

- (void)willPresentActionSheet:(UIActionSheet *)actionSheet_
{
//TIMOB-15939. Workaround rendering issue on iPAD on iOS7
if (actionSheet_ == actionSheet && forceOpaqueBackground &&[TiUtils isIOS7OrGreater] && [TiUtils isIPad]) {
NSArray* subviews = [actionSheet subviews];

for (UIView* subview in subviews) {
[subview setBackgroundColor:[UIColor whiteColor]];
}
[actionSheet setBackgroundColor:[UIColor whiteColor]];
}
}

- (void)actionSheet:(UIActionSheet *)actionSheet_ didDismissWithButtonIndex:(NSInteger)buttonIndex;
{
if (buttonIndex == -2)
Expand Down

0 comments on commit 5f30b38

Please sign in to comment.