private void setListNavigation(ActionBar bar) {
String[] actions = new String[] {
"Bookmark",
"Subscribe",
"Share"
};
ArrayAdapter < String > adapter = new ArrayAdapter < String > (getBaseContext(), android.R.layout.simple_spinner_dropdown_item, actions);
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
bar.setDisplayShowTitleEnabled(false); // hide application title from action bar
bar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#dedfde")));
}
当我尝试将微调器添加到我的操作栏时,它没有出现。我只得到小箭头图标。
下面是我的onCreate()
方法
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_prime_mobile_home);
ActionBar bar = getActionBar();
setListNavigation(bar);
}