private void ActionBarTabsSetup(ActionBar actionBar) { try { for (int i = 0; i < actionBar.TabCount; i++) { global::Android.App.ActionBar.Tab dashboardTab = actionBar.GetTabAt(i); if (TabIsEmpty(dashboardTab)) { string file = string.Empty; if (_tabbedPage.Children[i].Icon != null) { file = System.IO.Path.GetFileNameWithoutExtension(_tabbedPage.Children[i].Icon.File); } int id = Resources.GetIdentifier(file, "drawable", Context.PackageName); global::Android.App.ActionBar.Tab selectedTab = actionBar.SelectedTab; bool isSelected = false; if (selectedTab == dashboardTab) { isSelected = true; } TabSetup(dashboardTab, id, isSelected); } } } catch (System.Exception) { } }
private void Tab_TabSelected(object sender, ActionBar.TabEventArgs e) { global::Android.App.ActionBar.Tab myTab = (global::Android.App.ActionBar.Tab)sender; if (myTab == null) { return; } ImageView iv = (ImageView)myTab.CustomView; if (iv != null) { iv.SetColorFilter(selectionColor); } }