2012-07-13 26 views
1

如何使菜單圖標顯示在標題旁邊,如下面的動作欄圖片? action barandroid如何使菜單圖標與標題並排

這是我的程序圖片,可以做到嗎?請大家幫忙〜感謝

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; 
} 

對不起,我是新用戶,不能上傳圖片。對不起,如果我不能很好地解釋我的問題。

+0

那麼你可以使用自己的自定義設計 – 2012-07-13 09:17:36

+0

如何我可以更改菜單圖標的位置嗎?我在這裏看到了這種問題,但他們詢問我想要的動作欄 – user1434388 2012-07-13 09:26:18

回答

1

您希望您的菜單項出現在動作條我相信?

添加到您的菜單項:

android:showAsAction="true" 
+0

我的底部菜單中的操作欄佈局 – user1434388 2012-07-13 09:29:12

+0

您想在屏幕底部顯示一個操作欄?你不能在菜單中放一個。 – 2012-07-13 11:56:07

+0

我想做底部的菜單欄和帶有文字的圖標並排顯示,就像我上面顯示的動作欄圖片 – user1434388 2012-07-15 06:38:43