Skip to content

Instantly share code, notes, and snippets.

@gavilanch
Created September 21, 2017 14:06
Show Gist options
  • Save gavilanch/b1223fcd1185a70e50036478ef428dad to your computer and use it in GitHub Desktop.
Save gavilanch/b1223fcd1185a70e50036478ef428dad to your computer and use it in GitHub Desktop.
// values/Strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="NewsListActivity.Tabs.AllNews.Header">All news</string>
<string name="NewsListActivity.Tabs.SavedNews.Header">Saved news</string>
</resources>
// values-es/Strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="NewsListActivity.Tabs.AllNews.Header">Todas</string>
<string name="NewsListActivity.Tabs.SavedNews.Header">Noticias Salvadas</string>
</resources>
// NewsListActivity
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
// Create your application here
SetContentView(Resource.Layout.NewsList);
ActionBar.NavigationMode = ActionBarNavigationMode.Tabs;
var tabsHeaderAllNews = Resources.GetString(Resource.String.NewsListActivity_Tabs_AllNews_Header);
var tabsHeaderSavedNews = Resources.GetString(Resource.String.NewsListActivity_Tabs_SavedNews_Header);
AddTab(tabsHeaderAllNews, new AllNewsListFragment());
AddTab(tabsHeaderSavedNews, new SavedNewsListFragment());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment