summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.iOS/Renderers/TabbedRenderer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.iOS/Renderers/TabbedRenderer.cs')
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/TabbedRenderer.cs30
1 files changed, 27 insertions, 3 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/TabbedRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/TabbedRenderer.cs
index f7ca834c..c6c07370 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/TabbedRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/TabbedRenderer.cs
@@ -134,6 +134,14 @@ namespace Xamarin.Forms.Platform.iOS
_loaded = true;
}
+ public override void ViewDidLoad()
+ {
+ base.ViewDidLoad();
+
+ if (!Forms.IsiOS7OrNewer)
+ WantsFullScreenLayout = false;
+ }
+
protected override void Dispose(bool disposing)
{
if (disposing)
@@ -306,14 +314,25 @@ namespace Xamarin.Forms.Platform.iOS
if (!_defaultBarColorSet)
{
- _defaultBarColor = TabBar.BarTintColor;
+ if (Forms.IsiOS7OrNewer)
+ _defaultBarColor = TabBar.BarTintColor;
+ else
+ _defaultBarColor = TabBar.TintColor;
+
_defaultBarColorSet = true;
}
if (!isDefaultColor)
_barBackgroundColorWasSet = true;
- TabBar.BarTintColor = isDefaultColor ? _defaultBarColor : barBackgroundColor.ToUIColor();
+ if (Forms.IsiOS7OrNewer)
+ {
+ TabBar.BarTintColor = isDefaultColor ? _defaultBarColor : barBackgroundColor.ToUIColor();
+ }
+ else
+ {
+ TabBar.TintColor = isDefaultColor ? _defaultBarColor : barBackgroundColor.ToUIColor();
+ }
}
void UpdateBarTextColor()
@@ -348,7 +367,12 @@ namespace Xamarin.Forms.Platform.iOS
item.SetTitleTextAttributes(attributes, UIControlState.Normal);
}
- TabBar.TintColor = isDefaultColor ? _defaultBarTextColor : barTextColor.ToUIColor();
+ // set TintColor for selected icon
+ // setting the unselected icon tint is not supported by iOS
+ if (Forms.IsiOS7OrNewer)
+ {
+ TabBar.TintColor = isDefaultColor ? _defaultBarTextColor : barTextColor.ToUIColor();
+ }
}
void UpdateChildrenOrderIndex(UIViewController[] viewControllers)