android-actionbar

Navigation Drawer Below Transparent Actionbar

天大地大妈咪最大 提交于 2019-12-10 22:29:34
问题 I'm getting a transparent Actionbar by using the following code that @GunnarKarlsson shows here: Transparent Actionbar: custom tabcolor getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY); ActionBar actionBar = getActionBar(); actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#330000ff"))); actionBar.setStackedBackgroundDrawable(new ColorDrawable(Color.parseColor("#550000ff"))); It works pretty much perfectly with the exception of how it affects the navigation

Android: How to hide the sliding menu when back button clicked

北战南征 提交于 2019-12-10 22:18:52
问题 I am using : https://github.com/iPaulPro/SlidingMenu library to implement Facebook like sliding menu, along with ActionBarSherlock library. The BehindContentView in my case is a ListFragment. 1. Click on an Image to get the behindView (calling toggle();). 2. onListItemClicked takes to an Activity_2 displaying the text of the item clicked. 3. in this Activity_2 when i click device back button i get the main Activity_1 but the behindView is open. Usually in Facebook or Google+ the behavior is

How to use native platform icons for ToolBarItems in Xamarin.Forms (programmatically)?

有些话、适合烂在心里 提交于 2019-12-10 22:03:07
问题 What I have: I have a Xamarin.Forms app with a ToolBar ( ActionBar on Android, Navigation Bar on iOS). Within the ToolBar I have a ToolBarItem to delete something. What I want: For the ToolBarItem mentioned above I want to use the native platform icons (f.e. a trash can). My question: What is the proper way to achieve this? It seems that the only way to do this is to add and load separate png-files as described here. For Android this is not such a big deal I can officially download the icon

Why my image on my custom Actionbar has unwanted left padding

泪湿孤枕 提交于 2019-12-10 21:43:48
问题 I customized the ActionBar by inflating a custom view. and my custom action bar XML layout is: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="fill_horizontal" android:background="@drawable/actionbar_bg" > <TextView android:id="@+id/ab_main_text" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout

Last tab in action bar is cropped, goes off screen

谁都会走 提交于 2019-12-10 21:38:21
问题 I'm making an Android app using tabs for navigation. I have a problem with the rendering of the last tab in the action bar; it goes off screen and is cropped (this happens as soon as the number of tabs is too big too fit in the screeen width as far as I can tell). I'm using the ActionBar.NAVIGATION_MODE_TABS navigation mode. I haven't been able to find any questions with the same problem, any ideas on how to prevent this behavior? 回答1: I have already answer a question like that one : Tab item

How to hide ActionBar and NavigationBar after a certain delay time?

♀尐吖头ヾ 提交于 2019-12-10 21:06:28
问题 I would hide navigation bar and action bar of my app after some second that display don't get touched, and expand current view to fullscreen. Then if user touch the screen (or better if he swipe down), make visible both again. How to? 回答1: You can use a Handler to delay certain actions. Handler h = new Handler(); h.postDelayed(new Runnable() { @Override public void run() { // DO DELAYED STUFF getActionBar().hide(); } }, delaytime); // e.g. 3000 milliseconds The actions you take inside the run

How to implement a drop down navigation action bar in Android after you've added it?

橙三吉。 提交于 2019-12-10 20:55:43
问题 By following this guide, http://wptrafficanalyzer.in/blog/adding-drop-down-navigation-to-action-bar-in-android/ I was able to add my drop down navigation bar. The click events and everything function. Now, how do I make it so once an option is selected, it navigates to a different screen with its own layout and different functions. Any help would be great, thanks in advance! Edit: This is what I have. My app runs for about a millisecond, and I can see a glimpse "Hello World" and then it

Android FRAGMENT 'requestFeature must be called'

元气小坏坏 提交于 2019-12-10 20:53:11
问题 I am having trouble trying to use 'requestFeature' in my FRAGMENT. My code is below, I am trying to set the actionbar as an overlay. @Override public void onCreate(Bundle savedInstanceState) { getActivity().requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY); super.onCreate(savedInstanceState); I do not want to use a theme because I don't want the whole app to be effected, only this fragment in particular. 回答1: You have to call requestWindowFeature() before the setContentView() in the

Options Menu not displaying on ActionBar

亡梦爱人 提交于 2019-12-10 20:02:41
问题 I wanted to display Menu in ActionBar using ActionBarActivity . I am getting options menu while clicking options button instead of displaying in the top of action bar. I need the options menu at top instead of clicking the options menu from 2.3 onwards My Code : public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ActionBar actionBar = getSupportActionBar

ActionBarCompat support library android:selectableItemBackground not working

自古美人都是妖i 提交于 2019-12-10 19:56:14
问题 I'm using the new ActionBarCompat support library. The action buttons in the actionbar should change their background when pressed, It works with Android 4.3 but not with Gingerbread. In Gingerbread if I press on a button it will not change the background. I even changed the selector: <style name="Theme.MyCustomTheme" parent="@style/Theme.AppCompat.Light"> <item name="selectableItemBackground">@drawable/actionbar_item_bg_selector</item> </style> And again it is working with Android 4.3 but