[mono-android] ActionBarSherlock
craig
craigrs84 at gmail.com
Thu Oct 11 21:23:38 UTC 2012
I found a bug in the action bar binding...
If you take the sample app
(https://github.com/xamarin/monodroid-samples/tree/master/ActionBarSherlock)
and try to implement tabs then you will get an error message:
"Action Bar Tab must have a Callback"
Below is a code snippet of what I am trying to do.
I'm basically just following the example outlined on the android site
(http://developer.android.com/guide/topics/ui/actionbar.html) under the
heading Adding Navigation Tabs, and substituting any standard classes for
the Sherlock classes or Support classes. I have tried the exact same code
converted to Java and using the standard Android API and it works fine, but
unfortunately a bug exists in Mono or the Mono JAR binding.
Below is a short snippet of what I am trying to accomplish:
public class TabActivity : SherlockFragmentActivity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.main);
ActionBar actionBar = SupportActionBar;
actionBar.NavigationMode = (int)ActionBarNavigationMode.Tabs;
actionBar.SetDisplayShowTitleEnabled(false);
Tab tab = actionBar.NewTab();
tab.SetTag("test");
TabListener listener = new TabListener(this, "test",
typeof(TestFragment));
tab.SetTabListener(listener);
*actionBar.AddTab(tab); //ERROR OCCURS ON THIS LINE*
}
}
--
View this message in context: http://mono-for-android.1047100.n5.nabble.com/ActionBarSherlock-tp5710482p5712159.html
Sent from the Mono for Android mailing list archive at Nabble.com.
More information about the Monodroid
mailing list