android-actionbar

Action Bar in API Level > 3.0 but Still Support API < 3.0

心不动则不痛 提交于 2019-12-08 06:58:52
问题 Yet another compatibility question. THE PROBLEM I need to use a tabbed action bar in api level 3.0 and greater to switch between fragments . However, I also need to be able to switch between these fragments somehow in api level < 3.0. The spanner in the works is the fact that I have already downloaded a custom compatibility library that allows me to use google maps with fragments and therefore I can't use a library. THE QUESTION How can I implement a tabbed ActionBar solution in 3.0 and

Change ActionBar color in a Fragment

天涯浪子 提交于 2019-12-08 06:48:09
问题 In Xamarin, how can I change the ActionBar background color and text color in a Fragment ? Here is the code that works in an Activity : ColorDrawable colorDrawable = new ColorDrawable(Color.White); ActionBar.SetBackgroundDrawable(colorDrawable); int titleId = Resources.GetIdentifier("action_bar_title", "id", "android"); TextView abTitle = (TextView) FindViewById(titleId); abTitle.SetTextColor (Color.Black); If I have the same code, for the same project, in a Fragment , I get the following

Share ActionBar between different activities

偶尔善良 提交于 2019-12-08 05:45:37
问题 I have an application with an FragmentActivity called MainActivity which holds two fragments, one menu fragment to the left and one content fragment to the right. On a large device both of these fragments are shown. On a small device only the menu fragment is shown and when the user presses an item in said menu the content fragment is displayed in a new Activity . Lets say the user is currently using the application on his phone and only the menu is visible: The ActionBar of MainActivity can

Action Bar icon not showing in android action bar

你。 提交于 2019-12-08 05:26:27
问题 I have implemented Navigation drawer in my application in the main activity. I want to add a home button to the title bar of my app, in addition to the navigation drawer. I want this home button to be placed on the top right side of the title bar of my app. I have done several methods, but still the action bar icon is not showing in the title bar. Instead, an overflow button is shown at the top right portion of the action bar / title bar. When the overflow button is clicked, the home button

Why the fragment overlaps the Action bar?

五迷三道 提交于 2019-12-08 05:10:31
I tried to use the android support library v7 to add an action bar to my activity my extending tht actionbar activity. A blank fragment has been also built to make a tab. However, the content of the fragment is overlapping the action bar. How can I fix it? Vivek Mishra I read it here ActionBar with support library and Fragments overlay content I am sure it will help you : For pre ICS devices you must use: R.id.action_bar_activity_content instead of android.R.id.content R.id.action_bar_activity_content is a new id used in layout for displaying app content, it would appear that it replace

Custom viewpager tabs with custom view, multiple fragment and layouts

送分小仙女□ 提交于 2019-12-08 04:33:30
I want to make a viewpager which is just like latest facebook application. and the problem is with tabs. however i tried to make it, but i need icons with text in tabs and multiple fragments and layouts associated with it. two issue occurred when i tried to develop. 1. I compromised with my UI, and tried putting static icons in it, but they don't change on selection and they don't even have badge like in facebook application. 2. when i put that code in my application which i have developed in demo app, it shows error and after researching i found that my application don't have an actionbar. so

How to disable recreation of the first Fragment in FragmentPagerAdapter on tab Selected?

若如初见. 提交于 2019-12-08 04:23:53
问题 onCreateView for my first fragment in the FragmentPagerAdapter is not very quick. So, changing curent tab to the first has a delay. How to disable recreate first Fragment in FragmentPagerAdapter on tab Selected? private class TabsAdapter extends FragmentPagerAdapter implements ViewPager.OnPageChangeListener, ActionBar.TabListener { private final Context context; private ActionBar bar; private final ViewPager viewPager; private final ArrayList<TabInfo> tabs = new ArrayList<TabInfo>(); final

Android build error: Program type already present: android.support.v7.app.**

人盡茶涼 提交于 2019-12-08 03:39:49
问题 There are quite a few questions like this, but none of them seem to solve my issue, so maybe it's more specific to the library listed in the error message. I have tried just about everything other answers have suggested, but still see the same error. I also get a Run Tasks error but I have multiDexEnabled true . Caused by: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: Program type already present: android.support.v7.app.ActionBar$LayoutParams Message

Showing refreshing message in Action Bar

≡放荡痞女 提交于 2019-12-08 03:19:07
问题 I'm using an Action Bar (a regular one, not sherlock) in my android app, and when the app opens I want to show a refreshing message in the action bar. This means I want to hide the menu items and title (similar to how the GMail app appears when it's refreshing). What is the best approach for this? Is it using a contextual action bar? Is it possible to show the refreshing animation just below the action bar, like in the GMail app (ie, the blue lines sliding over). I know I can use a 3rd party

Unable to Change ActionBar Size

◇◆丶佛笑我妖孽 提交于 2019-12-08 03:09:53
问题 I am Trying to change the Height of ActionBar ,the code i use is shown below MainActivity: public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); View view = View.inflate(getApplicationContext(), R.layout.actionbarview, null); actionBar.setCustomView