android-actionbar

Fragment with CollapsingToolbar showing Activity Toolbar

和自甴很熟 提交于 2019-12-14 02:43:24
问题 I have a CollapsingToolbarLayout in my fragment and is showing fine, the thing is that App Toolbar is also being showed. I try this solution: Can I use CollapsingToolbarLayout in a Fragment from Navigation Drawer but is not working for me... This is my fragment AppBarLayout: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height=

Drop down seekbar in Android actionbar?

为君一笑 提交于 2019-12-14 02:00:11
问题 I'm trying to put a dropdown/pulldown seekbar in the actionbar. I thought something like this in OnCreateOptionsMenu() would work: SubMenu subMenu = menu.addSubMenu("DropTest"); MenuItem seekBarDrop = subMenu2.add("SeekBar"); SeekBar seekBar = new SeekBar(this); seekBarDrop.setActionView(seekBar); seekBarDrop.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); MenuItem subMenuItem = subMenu2.getItem(); subMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); But it fails miserably. I've also

ActionBar text color change while using ActionBarCompat

匆匆过客 提交于 2019-12-14 01:01:13
问题 I'm failed change the ActionBar Title color (by using ActionBarCompat ) by style.xml (not programatically) style.xml <style name="AppTheme" parent="AppBaseTheme"> <item name="android:windowBackground">@color/background_window</item> <!-- <item name="windowBackground">@color/background_window</item> --> <!-- <item name="android:actionBarStyle">@style/ActionBarStyle</item> --> <item name="actionBarStyle">@style/MyActionBar</item> </style> <style name="MyActionBar" parent="@style/Widget

Actionbar Tab in API 10

左心房为你撑大大i 提交于 2019-12-13 22:14:46
问题 I have an app with 4 actionbar's tabs. Although I imported android.support.v7.app. ActionBar library, it's only displayed in API 16 device but not in API 10 device. What's the solution here? Main Activity: import android.app.ActionBar; import android.support.v4.app.FragmentManager; import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager.OnPageChangeListener; import android.support.v7.app.ActionBar.TabListener; import android.support.v7.app.ActionBarActivity; public

Menu items won't show up in the actiobar

霸气de小男生 提交于 2019-12-13 21:39:28
问题 UPDATE: It works on the tab, but on the phone it's overlayed for some reason I have a question regarding the menu items android uses for the ActionBar, I have a custom background for my actiobar (a picture) and set it in the code here. That piece of code works fine. But when I try to add a menu item, it fails. What I want is fairly simple, I want a button that says "save product as favorite" at the bottom of the screen, like the bottom-actionbar. But when I try to add the button as menu item

Navigation drawer with AppCompat and normal actionbar?

自作多情 提交于 2019-12-13 20:03:06
问题 I have currently, a navigation drawer, a actionbar(no toolbar), and in the styles i defined as parent Theme.AppCompat.Light . I want to stay at actionbar, but when i use that parent, i become the following error: "Attempt to invoke virtual method 'android.content.Context android.app.ActionBar.getThemedContext()' on a null object reference" in that code: mDrawerListView.setAdapter(new ArrayAdapter<String>( getActionBar().getThemedContext(), R.layout.navdrawer_item_row, android.R.id.text1, new

Display icon and title in the ActionBar in Android

时光总嘲笑我的痴心妄想 提交于 2019-12-13 19:18:15
问题 I want to display both icon and title in the action bar of an Activity. Here is the screenshot of my app now: Now I need the app logo be displayed to the left of MyApp text in the action bar. I have already tried the following code to set the logo but nothing happened: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getSupportActionBar().setLogo(R.drawable.ic_launcher_web); getSupportActionBar().setDisplayUseLogoEnabled(true); setContentView

Extra padding at the left end of action bar (after updated sdk)

梦想的初衷 提交于 2019-12-13 19:16:48
问题 I don't know how this padding came up, but there's no such padding until I updated my SDK to 21. Here's my code: mActionBar = getSupportActionBar(); mActionBar.setDisplayShowHomeEnabled(false); mActionBar.setDisplayShowTitleEnabled(false); actionBarView = LayoutInflater.from(this).inflate(R.layout.title_bar_layout, null); mActionBar.setCustomView(actionBarView, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); mActionBar.setDisplayShowCustomEnabled(true); Does anyone

How to change the Option menu icon in the Action Bar?

£可爱£侵袭症+ 提交于 2019-12-13 17:09:00
问题 On Honeycomb, when the options are hidden (not ifRoom), they are displayed in a Spinner in an option menu. I simply would like to know how to change the icon of this option menu (furthest to the right). By default, the icon is just three lines and 3 dots on ICS. Thanks ! 回答1: See more attributes from your android sdk installation, in platforms/android-XX/data/res/values/style.xml Here is menu overflow action button style definition: <style name="Widget.Holo.ActionButton.Overflow"> <item name=

ActionBar get current icon, findviewbyid

我们两清 提交于 2019-12-13 16:25:52
问题 I know how to set the icon of the actionbar, but how do I determine what icon is currently there? I don't see an accessor like getIcon , I think it is possible to find the icon view by id, since I've done this with the search widget in the actionbar, but I wouldn't know what id to call. 回答1: According to the source code of ActionBarView.HomeView you should be able to get ImageView of icon by android.R.id.home . So code may look like: ImageView imageView = (ImageView) findViewById(android.R.id