我想摆脱上下文操作栏中的'刻度线'。它可能是模式中使用的方法。(某种方法);但我无法弄清楚哪一个(如果有的话)。 minsdk = 14
以下是摘录:
private ActionMode.Callback mActionModeCallback = new ActionMode.Callback()
{
// Called when the action mode is created; startActionMode() was called
public boolean onCreateActionMode(ActionMode mode, Menu menu)
{
// inflate a menu resource providing context menu items
MenuInflater inflater = mode.getMenuInflater();
//TextView tv= (TextView)getLayoutInflater().inflate(R.layout.contextual_title, null);
//mode.setTitle("ActionMode title");
//mode.setCustomView(tv);
// assumes that you have "contexual.xml" menu resources
inflater.inflate(R.menu.contextual, menu);
return true;
}
}
contextual.xml
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/toast"
android:title="Toast">
</item>
<item
android:id="@+id/toast"
android:title="NotToast">
</item>
</menu>
答案 0 :(得分:0)