我不知道菜单文本颜色的变化。它是默认的白色。我正在尝试更改 RED。这是我的代码:-
 MenuInflater menuInflater = getMenuInflater();
            menuInflater.inflate(R.layout.menu, menu);
            getLayoutInflater().setFactory(new Factory() {
                 public View onCreateView(String name, Context context,
                AttributeSet attrs) {
                if (name     .equalsIgnoreCase("com.android.internal.view.menu.IconMenuItemView")) {
                try {
                LayoutInflater f = getLayoutInflater();
                final View view = f.createView(name, null, attrs);
                new Handler().post(new Runnable() {
                public void run() {
                // set the background drawable
            //  view     .setBackgroundResource(R.drawable.my_ac_menu_background);
                // set the text color
                ((TextView) view).setTextColor(Color.RED);
                }
                });
                return view;
                } catch (InflateException e) {
                } catch (ClassNotFoundException e) {
                }
                }
                return null;
                }
                });
                return super.onCreateOptionsMenu(menu);
但这不起作用。工厂返回 NULL 值。
请任何人看一看。
谢谢你