android-actionbar

How to set same font family to entire android application

会有一股神秘感。 提交于 2019-12-11 09:37:07
问题 Hello I want to set same font family to entire Android application. I have seen this Is it possible to set a custom font for entire of application? but this all doing using code. I want to set in Theme such that it will work in all. It should convert the font family of ActionBar text also. Any way to do this ? styles.xml <resources> <!-- Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. --> <style name=

Action bar doesn't accept personal styles

拟墨画扇 提交于 2019-12-11 09:27:58
问题 I am trying to personilize my action bar. I want it to support API-9 and above the problem is that action bar doesn't accept changed made in styles.xml and items are not shown. this is my styles.xml : <resources> <style name="AppBaseTheme" parent="Theme.AppCompat.Light"></style> <style name="AppTheme" parent="AppBaseTheme"> <item name="android:windowBackground">@color/background_window</item> <item name="android:actionBarStyle">@style/ActionBarStyle</item> </style> <style name="ActionBarStyle

Programmatically display actionbar overflow

旧时模样 提交于 2019-12-11 09:26:16
问题 I have an actionbar with a menu. When you click the button, the menu shows up and all is well with the world. <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/reload" android:title="@string/reload" android:alphabeticShortcut="r" android:numericShortcut="1" android:titleCondensed="Rload"></item> <group android:id="@+id/adv" android:menuCategory="secondary"> ...options </group> </menu> However, I just got told that

How to check that options menu is opened?

旧巷老猫 提交于 2019-12-11 09:24:43
问题 How to check that options menu is opened? (menu in actionbar, or menu from preference button in older devices) There is some method for this? 回答1: Have a look at this SO question : How do I programmatically check if the menu of my activity is showing at a particular moment? Not a proper solution but the best workaround possible at the moment. 来源: https://stackoverflow.com/questions/20990197/how-to-check-that-options-menu-is-opened

Why the menu items appear on the optionsMenu?

喜欢而已 提交于 2019-12-11 08:59:11
问题 Despite there are some icons associated with certain action and have no enough space in the Actionbar , they appear in the optionsMenu instead of appearing in the overflow icon. I am inflating the actionBar with five icons each one has a specific functionality "Please refer to the XML file below", the items which have the android:showAsAction=never I expect them to implicitly reside inside the overflow icon on the actionBar , but when I run the App, any item with the property android

Error SearchView in ActionBar

本小妞迷上赌 提交于 2019-12-11 08:33:01
问题 I have a Action Bar with Search View and I have a Fragment set has Option Menu. In my MainActivity SearchView work fine but in my Fragment (I need handle event OptionMenuItem to do something), after setHasOptionMenu then SearchView can't work. Here is my code Option Menu in MainActivity public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); // Create SearchView SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);

how to initialize(pass arguments) fragments for action bar tabs?

感情迁移 提交于 2019-12-11 08:14:34
问题 I followed http://developer.android.com/guide/topics/ui/actionbar.html#Tabs It uses the following code to add Tab. Tab tab = actionBar.newTab() .setText(R.string.artist) .setTabListener(new TabListener<ArtistFragment>( this, "artist", ArtistFragment.class)); actionBar.addTab(tab); I want to supply argument to the fragment's constructor or call myInit(myVariableList) method on the fragment instance before showing the tab for the first time. How can I do that? 回答1: You can use tab.setTag() to

Hardware menu button not opening in Samsung galaxy tab 3

霸气de小男生 提交于 2019-12-11 07:19:17
问题 I have a samsung galaxy tab3 and I have the menu implemented in the usual manner - i.e. @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.game_menu, menu); return true; } and for menu selected @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle item selection switch (item.getItemId()) { case R.id.new_game: newGame(); return true; case R.id.help: showHelp(); return true; default: return super

Setting HomeAsUpEnabled(true) but hide back button actionbar

自闭症网瘾萝莉.ら 提交于 2019-12-11 06:53:28
问题 I can't seem to find a solution for this anywhere. I just want to make the logo clickable in my activity, but it seems the only way to do this is setHomeAsUpEnabled(true), but this makes the back icon visible and clickable. I want to make the logo clickable, why isn't this possible? Do I have to create a custom view for this? 来源: https://stackoverflow.com/questions/28132061/setting-homeasupenabledtrue-but-hide-back-button-actionbar

Image size for ActionBarSherlock background

给你一囗甜甜゛ 提交于 2019-12-11 06:38:08
问题 If I were to get an art asset made intended for use as the background of an ActionBar, what size (in pixels) should I request? Everything I have found referencing the size of an ActionBar has been in dp, so I'm unsure what would be the best absolute size to go with for the actual .png file. Thanks! 回答1: The action bar can be 40, 48, or 56 dp in height depending on configuration. This means that because of how Android scales things by density there are 9 different absolute pixel heights. The