1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-17 16:53:26 +00:00

style headers and footer

This commit is contained in:
Kyle Spearrin
2019-07-02 22:27:21 -04:00
parent 87e337cbeb
commit fa2e814559

View File

@@ -8,34 +8,40 @@ namespace Bit.iOS.Core.Views
{ {
public override void WillDisplayHeaderView(UITableView tableView, UIView headerView, nint section) public override void WillDisplayHeaderView(UITableView tableView, UIView headerView, nint section)
{ {
if(headerView != null && headerView is UITableViewHeaderFooterView hv) if(headerView != null)
{ {
hv.BackgroundColor = ThemeHelpers.ListHeaderBackgroundColor; headerView.TintColor = ThemeHelpers.ListHeaderBackgroundColor;
hv.TintColor = ThemeHelpers.ListHeaderBackgroundColor; headerView.BackgroundColor = ThemeHelpers.ListHeaderBackgroundColor;
if(hv.BackgroundView != null) if(headerView is UITableViewHeaderFooterView hv)
{ {
hv.BackgroundView.BackgroundColor = ThemeHelpers.ListHeaderBackgroundColor; if(hv.BackgroundView != null)
} {
if(hv.TextLabel != null) hv.BackgroundView.BackgroundColor = ThemeHelpers.ListHeaderBackgroundColor;
{ }
hv.TextLabel.TextColor = ThemeHelpers.MutedColor; if(hv.TextLabel != null)
{
hv.TextLabel.TextColor = ThemeHelpers.MutedColor;
}
} }
} }
} }
public override void WillDisplayFooterView(UITableView tableView, UIView footerView, nint section) public override void WillDisplayFooterView(UITableView tableView, UIView footerView, nint section)
{ {
if(footerView != null && footerView is UITableViewHeaderFooterView fv) if(footerView != null)
{ {
fv.BackgroundColor = ThemeHelpers.ListHeaderBackgroundColor; footerView.TintColor = ThemeHelpers.ListHeaderBackgroundColor;
fv.TintColor = ThemeHelpers.ListHeaderBackgroundColor; footerView.BackgroundColor = ThemeHelpers.ListHeaderBackgroundColor;
if(fv.BackgroundView != null) if(footerView is UITableViewHeaderFooterView fv)
{ {
fv.BackgroundView.BackgroundColor = ThemeHelpers.ListHeaderBackgroundColor; if(fv.BackgroundView != null)
} {
if(fv.TextLabel != null) fv.BackgroundView.BackgroundColor = ThemeHelpers.ListHeaderBackgroundColor;
{ }
fv.TextLabel.TextColor = ThemeHelpers.MutedColor; if(fv.TextLabel != null)
{
fv.TextLabel.TextColor = ThemeHelpers.MutedColor;
}
} }
} }
} }