如果我定義了以下項目爲我的行動吧:定義操作欄溢出項目
res/menu/action_menu.xml
:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:title="label"/>
<item android:title="label1"/>
<item android:title="label2"/>
<item android:title="label3"/>
<item android:title="label4"/>
</menu>
在我的活動:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.action_menu, menu);
return true;
}
反正是有讓我定義某些項目移動到行動溢出部分?以及如何做到這一點?
P.S. Action overflow part是隱藏某些項目(如彈出式菜單)的操作欄的最右側部分。
你聲明的所有項目都會溢出,你需要用setAsAction聲明才能顯示爲動作 – 2012-02-14 11:27:12