在代碼中設置uitabbarcontroller的SelectedTabIndex時,它忠實地更改顯示的選項卡,但TabItem不會突出顯示。我必須手動觸摸它才能將TabItem變成「藍色」並突出顯示。iPhone:設置SelectedTabIndex不會突出顯示TabItem
有沒有辦法強制TabItem突出顯示?
我們試過這樣:
public override void ViewWillAppear (bool animated)
{
base.ViewWillAppear (animated);
this.SelectedIndex = 0;
this.SelectedViewController = this.ViewControllers[0];
this.TabBar.SetNeedsDisplay();
}
嘗試在uitabbarcontroller的tabbar上調用setNeedsDisplay? – deanWombourne 2011-04-12 14:09:38