繰り返しますが、ここでアクション バー sherlock を使用して途方に暮れています..追加したボタンがまったく表示されないようです。これが私がすでにやったことです
私のマニフェストで
<activity android:name=".RecipeBookList" android:theme="@style/SherlockCustom"></activity>
そして私のstyles.xmlで
<style name="SherlockCustom" parent="@style/Theme.Sherlock.Light">
<item name="abHeight">25dip</item>
<item name="abBackground">#ffffff</item>
<item name="abDisplayOptions">useLogo|showHome|homeAsUp|showTitle</item>
</style>
そして私の RecipeBookList.java で
public class RecipeBookList extends FragmentActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.recipebooklist);
GridView gridview = (GridView) findViewById(R.id.gridview);
gridview.setAdapter(new ImageAdapter(this));
gridview.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
//Toast.makeText(RecipeBookList.this, "" + position, Toast.LENGTH_SHORT).show();
displayRecipeList(""+position);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.mainmenu, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
Toast.makeText(this, "Just a test", Toast.LENGTH_SHORT).show();
return true;
}
私のmainmenu.xmlにある
<item android:id="@+id/preferences" android:title="Search" android:showAsAction="always|withText" android:icon="@drawable/ab_search"></item>
しかし、検索ボタンはアクションバーにまったく表示されません..実際、どこにも表示されません。私はどこで間違ったのですか?