android-actionbar

ActionBar SearchView not fully expanding in landscape mode

风格不统一 提交于 2019-12-21 09:29:04
问题 When using the action bar search interface, the widget expands to occupy the full width of the screen in portrait mode, but stops short in landscape mode. Is there a way to set the expansion layout params on the SearchView to fully fill the action bar when the user is typing a search? See image: Note: I'm not currently using ActionBar Sherlock Edit: Here's what I did to get it to extend the full width. searchView.setOnSearchClickListener(new OnClickListener() { private boolean extended =

Add ActionBar to a PreferenceActivity

China☆狼群 提交于 2019-12-21 09:24:29
问题 I am trying to make a Settings Activity using a PreferenceActivity . The problem is that the ActionBar won't show up no matter what I do. I've tried getSupportActionBar , getActionBar , setActionBar . Nothing works. I see other apps settings with ActionBar s. Do they not use PreferenceActivity ? 回答1: If you are using an AppCompat theme, you have to pay attention to some points. The PreferenceActivity doesn't extend the AppCompatActivity or the deprecated ActionBarActivity . As solution you

Android ActionBar: show/hide tabs dynamically?

99封情书 提交于 2019-12-21 09:02:17
问题 Is it possible to remove/restore the tab bar from the action bar dynamically? Up to now I did this by changing the navigation mode of the action bar. I used following code to remove and restore the tab bar: @Override public void restoreTabs() { getSupportActionBar() .setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); this.supportInvalidateOptionsMenu(); } @Override public void removeTabs() { getSupportActionBar() .setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); this

Showing indeterminate progress in Sherlock Action Bar

筅森魡賤 提交于 2019-12-21 06:56:02
问题 i`m trying to show indeterminate progress bar in ABS v. 4.0.2 by following code @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); setContentView(R.layout.main); getSherlock().setProgressBarIndeterminateVisibility(true); } on ICS virtual device it works fine, but progress do not shows in device with Android 2.1. what i`m doing wrong? 回答1: Make sure you import com.actionbarsherlock.view

onCreateOptionsMenu called after onResume on JB 4.2

情到浓时终转凉″ 提交于 2019-12-21 06:52:59
问题 I have the following fragment in my application: public class MyFragment extends SherlockListFragment implements LoaderManager.LoaderCallbacks<Cursor> { private MenuItem refresh = null; @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); setHasOptionsMenu(true); //..... // NPE here refresh.setActionView(R.layout.indeterminate_progress_action); getActivity().getSupportLoaderManager().initLoader(0, null, this); } @Override public

Can't display sub-menu for custom ActionProvider

你。 提交于 2019-12-21 06:34:56
问题 I've created a custom ActionProvider that I want to use to show a sub-menu for sorting, similar visually to ShareActionProvider . The action view displays as expected, but clicking on the icon doesn't display the sub-menu or show any visual feedback (pressed state) at all. I'm using the support v7 library for backward compatibility action bar. Is there an implementation I am missing to display the menu? ActionProvider: public class SortActionProvider extends ActionProvider implements

Can't display sub-menu for custom ActionProvider

断了今生、忘了曾经 提交于 2019-12-21 06:34:10
问题 I've created a custom ActionProvider that I want to use to show a sub-menu for sorting, similar visually to ShareActionProvider . The action view displays as expected, but clicking on the icon doesn't display the sub-menu or show any visual feedback (pressed state) at all. I'm using the support v7 library for backward compatibility action bar. Is there an implementation I am missing to display the menu? ActionProvider: public class SortActionProvider extends ActionProvider implements

Android: how to change action bar background color? [closed]

蹲街弑〆低调 提交于 2019-12-21 06:19:30
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . The color of my android application is black. I wish to change it to other color. What is the easiest way to do it? I have tried to make a theme from this link When the application is opened, I could see that the action bar has changed the color from black to other color but in about 3 seconds, there is a

How to load a circular appcompat actionbar logo using glide

馋奶兔 提交于 2019-12-21 06:18:14
问题 Till now I have done the following, if I omit the circular image creation part it works fine, but I must show a circular image in actionbar here is what I have tried so far, any help will be highly appreciated Glide.with(mContext) .load(doctorDetailsList.get(0).getDoc_imgurl().replace("200x200", Measuredwidth + "x" + Measuredwidth)) .placeholder(R.drawable.no_image) .override(Measuredwidth, Measuredwidth) .into(new Target<GlideDrawable>() { @Override public void onLoadStarted(Drawable

Is it possible to put Android ActionBar on the bottom?

≯℡__Kan透↙ 提交于 2019-12-21 05:57:08
问题 i'm developing an application to an Android Tablet (XOOM), and i would like to know if it is possile to put the action bar on the bottom of the screen, instead of the top (which is the default option). Thanks. 回答1: if you're getting your ActionBar in an Activity you could just add this android:uiOptions="splitActionBarWhenNarrow" to your manifest for that specific Activity. That worked for me :) 回答2: Yes it is possible like this,try this. public void setActionBArAtBottom(View layoutView,