Skip to content

Commit

Permalink
Styling hints per user request https://github.com/phonegap/phonegap-p…
Browse files Browse the repository at this point in the history
  • Loading branch information
RandyMcMillan authored and purplecabbage committed May 16, 2012
1 parent dc465ed commit 943d2e5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
1 change: 0 additions & 1 deletion iOS/ChildBrowser/ChildBrowser.min.js

This file was deleted.

29 changes: 23 additions & 6 deletions iOS/NativeControls/NativeControls.m
Expand Up @@ -67,6 +67,15 @@ - (void)createTabBar:(NSArray*)arguments withDict:(NSDictionary*)options
tabBar.opaque = YES;
self.webView.superview.autoresizesSubviews = YES;

/* Styling hints REF UIInterface.h
tabBar.alpha = 0.5;
tabBar.tintColor = [UIColor colorWithRed:1.000 green:0.000 blue:0.000 alpha:1.000];
*/



[self.webView.superview addSubview:tabBar];
}

Expand Down Expand Up @@ -321,8 +330,9 @@ - (void)createToolBar:(NSArray*)arguments withDict:(NSDictionary*)options
{
CGFloat height = 45.0f;
BOOL atTop = YES;
UIBarStyle style = UIBarStyleBlackOpaque;

UIBarStyle style = UIBarStyleBlack;
//UIBarStyle style = UIBarStyleDefault;

NSDictionary* toolBarSettings = options;//[settings objectForKey:@"ToolBarSettings"];
if (toolBarSettings)
{
Expand All @@ -338,9 +348,9 @@ - (void)createToolBar:(NSArray*)arguments withDict:(NSDictionary*)options
if ([styleStr isEqualToString:@"Default"])
style = UIBarStyleDefault;
else if ([styleStr isEqualToString:@"BlackOpaque"])
style = UIBarStyleBlackOpaque;
style = UIBarStyleBlackOpaque;//deprecated
else if ([styleStr isEqualToString:@"BlackTranslucent"])
style = UIBarStyleBlackTranslucent;
style = UIBarStyleBlackTranslucent;//deprecated
}

CGRect webViewBounds = self.webView.bounds;
Expand All @@ -359,12 +369,19 @@ - (void)createToolBar:(NSArray*)arguments withDict:(NSDictionary*)options
toolBar = [[UIToolbar alloc] initWithFrame:toolBarBounds];

[toolBar sizeToFit];
toolBar.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleWidth;
toolBar.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleWidth;
toolBar.hidden = NO;
toolBar.multipleTouchEnabled = NO;
toolBar.autoresizesSubviews = YES;
toolBar.userInteractionEnabled = YES;
toolBar.barStyle = style;
toolBar.barStyle = style; //set in line: 324 above UIBarStyle style = UIBarStyleBlack;

/* Styling hints REF UIInterface.h
toolBar.alpha = 0.5;
toolBar.tintColor = [UIColor colorWithRed:1.000 green:0.000 blue:0.000 alpha:1.000];
*/


[toolBar setFrame:toolBarBounds];
Expand Down

0 comments on commit 943d2e5

Please sign in to comment.