ActionBar

How to get “?android:attr/actionBarSize” with Compatibility Library

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to use Fragments and ActionBar in a Android 2.2 project. There is some error when using "?android:attr/actionBarSize", how to get and set that value correctly? Example: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/frags"> <fragment class="com.example.android.hcgallery.TitlesFragment" android:id="@+id/frag_title" android:visibility="gone" android:layout_marginTop="?android:attr

Disable ActionBar RTL Direction

匿名 (未验证) 提交于 2019-12-03 02:51:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Android 4.2 introduced RTL (BiDi) support, to start using it I just follow the instructions (android:supportsRtl attribute to the element in your manifest file and set it “true") But then my ActionBar logo also changes orientation to the right (Logo is displayed on the right) which I don't want. I do want to use the RTL features but keep the ActionBar oriented to the left... In other word, how do I use the android:supportsRtl attribute without it changing the ActionBar direction on Android 4.2 when the language direction is RTL Any

dynamic drawable icon for ActionBar menu item? (Android, ActionBarSherlock)

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How can I dynamically update the icon for an ActionBar MenuItem to show a 'red badge' with a number? (conceptually similar to "unread message count') I'm using ActionBarSherlock in my Android application, targeting API level 10+. My application is for mobile data capture and, sometimes, the user cannot immediately submit new data but must save it locally on the phone (e.g. when connectivity is poor). Whenever there are 'unsubmitted' items stored locally on the phone, I'd like to show the user a menu item (in the Action Bar) so that they can

Android Studio Can&#039;t resolve fragmentActivity and ViewPager imports

匿名 (未验证) 提交于 2019-12-03 02:27:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I follow the tutorial of developing swipe-able tabs. When I import: import android.support.v4.app.FragmentActivity; import android.support.v4.view.ViewPager; Android Studio shows me cannot resolve the symbol "ViewPager" and "FragmentActivity". How to solve this? thanks. Below is the entire code of my project. import android.app.ActionBar; import android.app.ActionBar.Tab; import android.app.FragmentTransaction; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.view.ViewPager; public class

Android Activity without ActionBar

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have different Activities in my App and in all of them I do not want the Action Bar . I cannot find how to disable it. I have tried to find an attribute to apply it to the main_activity.xml but so far I did not find anything. Can somebody help me please? 回答1: Haha, I have been stuck at that point a while ago as well, so I am glad I can help you out with a solution, that worked for me at least :) What you want to do is define a new style within values/styles.xml so it looks like this <resources> <style name = "AppTheme" parent = "android

ActionBarDrawerToggle v7 arrow color

匿名 (未验证) 提交于 2019-12-03 02:15:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When I try to change navigation drawer toggle color, only hamburger changes it, arrow keeps her native color. You can see it here - <style name="AppTheme" parent="Theme.AppCompat.NoActionBar"> <item name="android:windowBackground">@drawable/app_background</item> <item name="android:dropDownListViewStyle">@style/DropDownListViewStyle</item> <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary_dark</item> <item name="colorAccent">@color/accent</item> <item name="android:textColor">@color/primary_text<

Android: Change color of line below ActionBar

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to change the color of the orange line below the ActionBar. I've tried a few things but nothing has helped so far. 回答1: You can use This code for achieving your purpose. background.xml <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <solid android:color="#ff0000" /> </shape> </item> <item android:bottom="5dp"> <shape android:shape="rectangle"> <solid android:color="#ffffff" /> </shape> </item> </layer-list> styles.xml <resources>

Change action bar color in android

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using the app theme Theme.Black in my app. In this theme the action bar is gray. How I can change color of my action bar? This is my attempt: <?xml version="1.0" encoding="utf-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="mytheme" parent="@android:style/Theme.Black" > </style> <style name="Widget.MyApp.ActionBar" parent="@android:style/Widget.ActionBar"> <item name="android:background">@android:color/black</item> </style> </resources> However, it doesn't work. Any ideas? 回答1: ActionBar bar =

Action Items not showing in ActionBar with showAsAction=“ifRoom”

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to add some Action Items to my Support Action Bar. In my activity, I have also tabs added to the Action Bar. This is an excerpt of the activity: public class ShowEmails extends ActionBarActivity implements ShowEmailsFragmentInteractionListener { private IMAPClientService service ; private boolean bound ; private ActionBar ab ; private MailDBHelper mdbhelper ; private SQLiteDatabase db ; private Intent client_service ; <.........................> @Override protected void onCreate ( Bundle savedInstanceState ) { super .

Warning when canceling ActionBar Overflow menu on Android 4.1.x

匿名 (未验证) 提交于 2019-12-03 02:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: This is the warning I'm getting: 03-02 14:38:43.980: W/InputEventReceiver(3961): Attempted to finish an input event but the input event receiver has already been disposed. The menu I have was generated from a regular res/menu/activity_menu.xml file. I'm handling the events exactly as detailed on http://developer.android.com/guide/topics/ui/menus.html#options-menu When I click the vertical three dots to open the overflow menu and cancel out of it, I get that warning. There seems to be little knowledge of how to catch its trigger.