0
我想爲TabHost中的每個選項卡添加背景。Xamarin:爲每個選項卡設置不同的背景(在TabHost中)
private void CreateTab(Type activityType, string tag, string label, int drawableId)
{
TabHost.TabSpec spec;
var intent = new Intent(this, activityType);
intent.AddFlags(ActivityFlags.NewTask);
spec = TabHost.NewTabSpec(tag);
var drawableIcon = Resources.GetDrawable(drawableId);
spec.SetIndicator(label, drawableIcon);
spec.SetContent(intent);
TabHost.AddTab(spec);
}
我使用上面的代碼來創建選項卡。
請幫忙, 謝謝。