Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Tabhost problems

$
0
0

hello C# developers,

I have problems with a "TabHost" control. I try to run this code, but I cant. I've read the "tabhost" documentation in this link but the problem persist. please help, what I doing wrong?

Somebody have the example "TabHostWalkthrough.zip"? because the link is broke. Thank you.

My code:

protected override void OnCreate(Bundle bundle):

base.OnCreate(bundle);
// Create your application here
SetContentView(Resource.Layout.frmDevice);
CrearTab(typeof(tabDeviceProperties), "properties", "Properties");

private void CrearTab(Type activityType, string tag, string label):

var intent = new Intent(this, activityType);
intent.AddFlags(ActivityFlags.NewTask);
var tab = FindViewById<TabHost>(Resource.Id.tabHost1);
var spec = tab.NewTabSpec(tag);
spec.SetIndicator(label);
spec.SetContent(intent);
tab.AddTab(spec);

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>