TabView for Xamarin.Android: Getting Started
To use RadTabView Beta a reference to the Primitives library first must be added to your project. Then simply create an instance:
RadTabView tabView = new RadTabView(this.Context);
Then add some tabs:
tabView.Tabs.Add(new Tab("Tab 1"));
tabView.Tabs.Add(new Tab("Tab 2"));
tabView.Tabs.Add(new Tab("Tab 3"));
Add a TabViewChangeListener:
tabView.AddChangeListener(this);
Finally, implement the change listener methods. One of those methods is called to create a content view for each tab:
public Java.Lang.Object GetContentViewForTab(Tab tab)
{
TextView contentView = new TextView(this.Context);
contentView.Text = "Content view for " + tab.Title;
contentView.Gravity = GravityFlags.Center;
return contentView;
}
That's all there is to it. The result is a fully functioning tab view: