William Jockusch
William Jockusch

Reputation: 27325

Getting a drop-down menu from the Android title bar via Xamarin

I'm working on a cross-platform Android/iOS app via Xamarin. I have an ActionBar, which is working. But I can't get a drop-down menu to appear when I tap on the app title ("GraCal" in the screen shot). How do I do that?

enter image description here

Upvotes: 0

Views: 1970

Answers (1)

Dave
Dave

Reputation: 2308

Try this:

protected override void OnCreate (Bundle bundle)
{
    ...

    ActionBar.SetHomeButtonEnabled (true);
}

public override bool OnOptionsItemSelected (IMenuItem item)
{
    switch (item.ItemId) {
    case Android.Resource.Id.Home:
        OpenOptionsMenu ();
        break;
    }
    return base.OnOptionsItemSelected (item);
}

Upvotes: 1

Related Questions