Center Align CheckBox in Options Menu

67 Views Asked by At

Is it possible to center align CheckBox in Options Menu? As you can see below, the checkbox is not aligned with submenuarrow. enter image description here

2

There are 2 best solutions below

0
Mücahid Kambur On

You can use android:actionLayout="@[package:]layout/layout_resource_name" attribute. With this attribute, you can design your menu like normal layout. Try app:actionLayout if android:actionLayout not work

0
propoLis On

You can solve it by adding checkable parameter.

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <item
        android:id="@+id/show_artists_item"
        android:checkable="true"
        android:title="Show Album Artists"
        android:visible="true"
        app:showAsAction="always" />

</menu>