From 943d2e5c998a41cb98172f53235e2366393b9635 Mon Sep 17 00:00:00 2001 From: Randy McMillan Date: Mon, 9 Apr 2012 15:25:05 -0400 Subject: [PATCH] Styling hints per user request https://github.com/phonegap/phonegap-plugins/issues/454 --- iOS/ChildBrowser/ChildBrowser.min.js | 1 - iOS/NativeControls/NativeControls.m | 29 ++++++++++++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) delete mode 100644 iOS/ChildBrowser/ChildBrowser.min.js diff --git a/iOS/ChildBrowser/ChildBrowser.min.js b/iOS/ChildBrowser/ChildBrowser.min.js deleted file mode 100644 index 51b8823e..00000000 --- a/iOS/ChildBrowser/ChildBrowser.min.js +++ /dev/null @@ -1 +0,0 @@ -function ChildBrowser(){}ChildBrowser._onLocationChange=function(newLoc){window.plugins.childBrowser.onLocationChange(newLoc)};ChildBrowser._onClose=function(){window.plugins.childBrowser.onClose()};ChildBrowser._onOpenExternal=function(){window.plugins.childBrowser.onOpenExternal()};ChildBrowser._onJSCallback=function(js,loc){};ChildBrowser.prototype.showWebPage=function(loc){Cordova.exec("ChildBrowserCommand.showWebPage",loc)};ChildBrowser.prototype.close=function(){Cordova.exec("ChildBrowserCommand.close")};ChildBrowser.prototype.jsExec=function(jsString){};ChildBrowser.install=function(){if(!window.plugins){window.plugins={}}window.plugins.childBrowser=new ChildBrowser();return window.plugins.childBrowser}; \ No newline at end of file diff --git a/iOS/NativeControls/NativeControls.m b/iOS/NativeControls/NativeControls.m index 393e234f..5bce3907 100644 --- a/iOS/NativeControls/NativeControls.m +++ b/iOS/NativeControls/NativeControls.m @@ -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]; } @@ -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) { @@ -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; @@ -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];