android-actionbar

ActionBarCompat - App icon action (click) not working on 4.0 devices

不羁岁月 提交于 2020-01-02 01:53:07
问题 I have this problem with the Android ActionBarCompat project: On emulators with Android 4.0 the click on the app icon doesn't cause any onOptionsItemSelected event, whereas it works on all other OS versions. Any input is greatly appreciated! 回答1: Are you seeing any touch feedback from the app icon? (Does it glow when you press it?) Since many activities do not use the action bar home button, in apps that target API 14+ running on Android 4.0 it is disabled by default. (This is so that users

How to set Android toolbar height?

早过忘川 提交于 2020-01-02 01:36:32
问题 I want to achieve this: What I thought was to make a Custom Toolbar with a bigger height and work with the tabhost and tabpager normally. I have implemented it, but the toolbar is showing the normal height, so it doesn't show as I want, just the top part. Is this the right approach or is it possible to set a TabHost below a Linear/Relative Layout? Because I don't need to work with it as an action bar. Relevant Code toolbar.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget

How to “install” Action Bar Sherlock?

房东的猫 提交于 2020-01-02 01:36:05
问题 I'm trying to build the sample project "Action Bar Styled" using the Action Bar Sherlock. I download the .zip file containing ABS here http://actionbarsherlock.com/ but I can't figure out where to unzip so that it will appear on Project>Properties>Add library. Can someone give me an hand? Also, I read somewhere (can't find it now, sorry) that the current Android Compatibility library supports the Action Bar in pre 3.0 versions, so it has basically the same "effect" as Action Bar Sherlock -

Android Split Action Bar-icons only in the bottom bar

做~自己de王妃 提交于 2020-01-01 20:23:19
问题 I want to force the icons to be placed in the Bottom bar of Android's split action bar, while making sure that the top action bar remains empty. I have experimented a lot, but have not been able to figure out how to do this. I am sure it is possible, because I have seen it in the Google Maps app. See the image below: split action bar with icons http://imageshack.us/a/img856/3592/portraito.png 回答1: The split action bar is only used on -small / -normal screens in portrait orientation -- in all

AppCompat v7 r21 changing Alpha of the ActionBar's title

别来无恙 提交于 2020-01-01 19:56:32
问题 With the previous versions of AppCompat it was easy to get the ActionBar 's title TextView and modify it. There is the method I was using: private TextView getActionBarTitleView() { int id = getResources().getIdentifier("action_bar_title", "id", "android"); return (TextView) findViewById(id); } And then to change the alpha's value of the title: getActionBarTitleView().setAlpha(ratio*255); Now for some reasons, "action_bar_title" with the lastest AppCompat version isn't working anymore. When I

Android 3.0: cannot style Action Bar 's action item buttons

為{幸葍}努か 提交于 2020-01-01 19:33:30
问题 Here is the dev guide related to the subject http://developer.android.com/guide/topics/ui/actionbar.html#ActionItems So we have in activity public class MyActivity extends Activity { @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.my_menu, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.first_menu_button:

v7-21 ActionBarActivity not showing the app main icon on the left

孤人 提交于 2020-01-01 18:23:59
问题 I implemented a basic activity as public class MainActivity extends Activity and when I add an actionbar with the menu as below, the app icon defined in the AndroidManifest.xml shows up nicely <application android:allowBackup="true" android:icon="@drawable/logo_green" android:label="@string/app_name" android:screenOrientation="portrait" android:theme="@style/Theme.AppCompat.Light.DarkActionBar" > When I try to change to android.support.v7.app.ActionBarActivity ( and switch to compatible

ActionBar spinner with an icon (like Google Maps), how can I achieve that?

本小妞迷上赌 提交于 2020-01-01 18:16:08
问题 I am currently trying, in addition of the amazing ActionBerSherlock library to add a spinner navigation menu in my application (like Google Maps) Note: I have been thinking also about the SPotify/Evernote/Facebook pattern, but that seems inappropriate on Android: http://alexanderblom.se/2012/04/23/android-navigation-and-spotify/ I have already worked on the spinner (http://developer.android.com/design/building-blocks/spinners.html), but adding an icon seems not so easy Thank a lot for any

Changing default text colour and still showing disabled menu items in different colour

a 夏天 提交于 2020-01-01 12:35:19
问题 With Theme.Holo.Light as the base theme, a designer noticed that the default text colour is not black, but a dark grey ( #505050 ). We'd like to change it to black. Looking for a simple way to change the default to black everywhere in the app, I found that this works: <resources> <style name="MyAppTheme" parent="android:Theme.Holo.Light"> <item name="android:textColor">@android:color/black</item> </style> </resources> Now, problem is , that also changes the colour of disabled items in Action

Method call mActionBar=getActionBar() gives error [closed]

家住魔仙堡 提交于 2020-01-01 11:51:12
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I am using support library android.support.v7.app.actionbar because i want action bar in api level 8 and above But following sentence gives me error like change mActionBar to ActionBar mActionBar=getActionBar(); My FragmentActivity in which I wnat to use ActionBar Tab is as follows import com.example