android如何与标题并排制作菜单图标

时间:2012-07-13 09:15:25

标签: android menu

如何在操作栏图片下方的标题旁边显示菜单图标? action bar

这是我的节目图片,有可能吗?请帮忙〜谢谢

my program

这是我的代码

public void openOptionsMenu() { 
    // TODO Auto-generated method stub 
    super.openOptionsMenu(); 
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    //call the base class to include system menus
    super.onCreateOptionsMenu(menu);

        int group1 = 1;
        MenuItem bakchome = menu.add(group1,1,1,"Add News");
        bakchome.setIcon(R.drawable.ic_menu_add);

    return true;
}

@Override 
public boolean onOptionsItemSelected(MenuItem item) {
        switch(item.getItemId()) {
        case 1:
            ProgressDialog progress1 = new ProgressDialog(News.this);
            progress1.setMessage("Loading...please wait..");
            progress1.setTitle("Planbiz");
            new MyTask(progress1).execute();
            Intent intent1 = new Intent(getApplicationContext(), News_Edit.class);

            startActivity(intent1);
            break;

        }

    return true;
}
抱歉,我是新用户,无法上传图片。对不起,如果我不能很好地解释我的问题。

2 个答案:

答案 0 :(得分:1)

您希望您的菜单项出现在我认为的操作栏中吗?

将此添加到您的菜单项:

android:showAsAction="true"

答案 1 :(得分:1)

这可能会对你有所帮助

Implementing custom menu in android system

他们还谈到了自定义菜单