Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

tabhost can not jump to the forms of the page

$
0
0

public class MainActivity : TabActivity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);

        SetContentView(Resource.Layout.layout1);
        Intent intent = new Intent().SetClass(this, typeof(Activity1));
        spec = tabHost.NewTabSpec("首页").SetIndicator("首页").SetContent(intent);
        tabHost.AddTab(spec);
   }

}

public class Activity1 : AndroidActivity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
Xamarin.Forms.Forms.Init(this, bundle);
SetPage(new MyFirstPage());
}
}

SetPage(new MyFirstPage()); Sentence report empty exception error。
But alone start Activity1. Is also possible


Viewing all articles
Browse latest Browse all 58056

Trending Articles