ActionBar

How to set the text color of titlebar?

匿名 (未验证) 提交于 2019-12-03 08:59:04
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using this as the theme. <style name="ThemeSelector" parent="android:Theme.Light"> <item name="android:windowTitleBackgroundStyle">@style/WindowTitleBackground</item> <item name="android:textAppearance">@style/TitleTextColor</item> </style> <style name="WindowTitleBackground"> <item name="android:background">@drawable/waterblue</item> </style> <style name="TitleTextColor"> <item name="android:textColor">@color/white</item> </style> With this background image is got assigned but text color is not changing. In manifest I am using like

Android Search Interface not submitting query

匿名 (未验证) 提交于 2019-12-03 08:56:10
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've implemented a Search Interface (the Search Widget) by following the official tutorial for Search Interface closely. It all looks good but I can't submit the search query. When I click the "Send" button on the keyboard nothing happens. Here is what I did: AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="18" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android

android:dividerPadding has no effect

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This theme works fine, referencing three custom styles for the 3 parts of the ActionBar's tabs. But the "dividerPadding" has no effect on any of them - running on API 17 devices. <style name="Theme.AppEmptyTitleBar" parent="android:style/Theme.Holo"> <item name="android:actionBarStyle">@style/AB</item> <item name="android:actionBarTabStyle">@style/ABT</item> <item name="android:actionBarTabBarStyle">@style/ABTB</item> </style> <style name="AB" parent="android:style/Widget.Holo.ActionBar"> <item name="android:dividerPadding">20dip</item> <

How to draw on ActionBar tab when using ActionBarSherlock in Android?

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using ActionBarSherlock to provide ActionBars for pre HoneyComb devices. My Activity has four fragments namely 1. User 2. Chat 3. Video 4. Extra, see image I have created actionBar using following code:- actionBar = getSupportActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); actionBar.setTitle("Meeting"); actionBar.setDisplayShowHomeEnabled(false); actionBar.setDisplayShowCustomEnabled(false); actionBar.setDisplayShowTitleEnabled(false); /* Set Custom view */ ActionBar.Tab tab = actionBar.newTab(); // tab.setText

Difference between actionBar back button and android back button

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What is the difference between actionBar back button and android back button? Because it's seems that the ActionBar back button which is called with: ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); it works way better... example: when I press the ActionBar back button the animations are there, but if I press the default back button they aren't. I can change theme from a preference activity: If I go back with the ActionBar back button the colors instantly changed, but with the default I have to restart

ActionBar SearchView not fully expanding in landscape mode

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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: http://i.imgur.com/3z8ZbJA.png 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 = false; @Override public

How to change actionBar icon size?

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The actionBar icon should like image When the device resolution is 1920x1080 and android 4.2 above, the icon size looks very small: image (android 4.1 is correct) My problem seems like i-want-to-change-actionbar-icon-size . The icon image size is 113x40, then I use getActionBar().getHeight() to get ActionBar height is 56. menu.xml: <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/menu_buyer" android:icon="@drawable/buyer_bts" android:showAsAction="ifRoom"/> <item android:id="@+id/menu_exhibition_bt"

Navigation Drawer icon not showing android

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: MainActivity.java public class MainActivity extends FragmentActivity { public DrawerLayout mDrawerLayout; public ListView mDrawerList; public ActionBarDrawerToggle mDrawerToggle; // nav drawer title public CharSequence mDrawerTitle; // used to store app title public CharSequence mTitle; // slide menu items public String[] navMenuTitles; public TypedArray navMenuIcons; public ArrayList<NavDrawerItem> navDrawerItems; public NavDrawerListAdapter adapter; ActionBar actionBar; TextView tvTitle, tvTitleNext; private Stack<Fragment> fragmentStack;

Android: required android.support.v7.app.ActionBar found android.app.ActionBar

匿名 (未验证) 提交于 2019-12-03 03:02:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to use the getActionBar(); method and I receive this error: required android.support.v7.app.ActionBar found android.app.ActionBar . How can I correct this? 回答1: This error is occurring because you are creating an object and passing it to a different class reference variable. Because getActionManager gives the object of android.app.ActionBar but you are trying to assign android.app.ActionBar class object to android.support.v7.app.ActionBar . But both these classes provide the same functionality. android.support.v7.app.ActionBar

Changing the actionbar menu state depending on fragment

匿名 (未验证) 提交于 2019-12-03 02:59:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to show/hide items in my action bar depending on which fragment is visible. In my MainActivity I have the following /* Called whenever invalidateOptionsMenu() is called */ @Override public boolean onPrepareOptionsMenu(Menu menu) { if(this.myFragment.isVisible()){ menu.findItem(R.id.action_read).setVisible(true); }else{ menu.findItem(R.id.action_read).setVisible(false); } return super.onPrepareOptionsMenu(menu); } This works great however, when the device is rotated there is a issue. After the rotation is complete