Question

So I achieved setting a custom ActionView for a MenuItem inside my ActionBar, great!
Now, how do I keep the menuItem showing it's title (set in xml)?

This is important as I want users to read what that button is doing.
The customView serves as a regular menuItem and is always expanded.

I tried setting ContentDescription to the custom layout containing the same title, but no luck so far.
Thanks!

Was it helpful?

Solution

Keep the content description, but in the constructor of your custom layout, setup Roman Nurik's CheatSheet. When you're using a custom MenuItem, it's up to you to make it accessible.

public ActionViewExample(Context context, AttributeSet attrs) {
    super(context, attrs);
    // Ensure the MenuItem is accessible
    CheatSheet.setup(this);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top