如何在OnCreate方法中添加运行时更改选项卡标题?

时间:2015-07-01 12:55:06

标签: xamarin xamarin.android

我正在使用此代码

protected override void OnCreate (Bundle bundle)
    {
        base.OnCreate (bundle);
        SetContentView (Resource.Layout.workflow_layout);

        ColorDrawable color=new ColorDrawable(Color.ParseColor("#1f3d55"));
        ActionBar.SetBackgroundDrawable (color);
        ActionBar.SetDisplayHomeAsUpEnabled (true);

        ActionBar.SetIcon (new ColorDrawable (new Color (global::Android.Resource.Color.Transparent)));
        ActionBar.SetDisplayHomeAsUpEnabled (true);

        Intent i = new Intent ().SetClass (this, typeof(Screens.WorkflowedToMeTab));
        TabHost.AddTab (TabHost.NewTabSpec ("").SetIndicator ("Workflowed To Me (" + FolderViewerActivity.count + ")").SetContent (i));
        TabHost.TabWidget.GetChildAt (0).SetBackgroundResource (Resource.Drawable.tab_shape);
        TabHost.TabWidget.GetChildAt (0).LayoutParameters.Height = TabHost.TabWidget.GetChildAt (0).LayoutParameters.Height * 2 / 3;
    }

0 个答案:

没有答案