I am working on an app for tablet that uses the Theme.NoTitleBar.Fullscreen: my tablet is under android 4.1.1 and the settings button should be on the top right corner of the app, but with such a style, the button (three little squares aligned vertically) is not visible... how can I fix that?
The button you are talking about is part of the title bar. So if you request to hide that one, your button is of course not accessible anymore.
You have to provide a button in your layout to access your settings screen. Or show the title bar.
You can use context menus for resolving this thing ... i was having the same problem... and if you want to use legacy overflow button (the three dots) please refer to this link http://android-developers.blogspot.in/2012/01/say-goodbye-to-menu-button.html
Related
I do not want to show a menu for only Settings and About, that's why i want the overflow button to open (immediately when clicked) a unified Settings-About page, the same way Instagram does.
At first i thought i might just do a menu with one action that is set to always Shown and has the overflow button icon (the three dots). But there are a lot of icons for different themes and i also think this wouldn't be correct for devices with a menu button.
Follow this:
Go to style, change your theme DarkActionBar to noActionBar.
Add the android design support to your gradle.
Add toolbar to your xml
Add Imageview or imageviewbutton inside your toolbar
Find the three dot image in drawable using image asset
Add your three dot drawable as src of your imageview.
Set oncClick then intent.
I'm using Appcelerator's Titanium Alloy to work on an app that features both a tab-group on the bottom of the screen and a toolbar on the top of the screen. These both will appear after login, and won't change until logged out. I have been able to create both the tab-group and the toolbar, but am having trouble having them both on the screen.
The toolbar that I'm going for is something similar to this:
How to create a header bar with buttons in Titanium JS?
Just a guess, but I think the views of the tab-group and the toolbar are getting overlapped with one another. As such, I'm only able to see one at a time, always the one I set second (i.e. it is on top of the other bar).
Any help/ideas are greatly appreciated.
Thank you!
Edit:
I've looked into adjusting the leftNavButton and rightNavButton properties, but to use this method would require each individual tab to be adjusted, instead of the entire tab group. I'd like to find a way to add these buttons universally, as the top and bottom bars do not change with different views.
You can use the rightNavButtons and leftNavButtons properties of the windows to add buttons to the navigationBar that is showing at the top of the screen in a tabgroup.
I have designed this simple login screen.
In the LoginActivity, I have not declared onCreateOptionsMenu or onPrepareOptionsMenu.
But still I am getting overflow like button at the screen bottom right as shown in the below picture. When I click on it, it does not do anything.
If it were an Action item it would be in the Action Bar area not along with the device's native soft buttons.
Does anybody know how can it be resolved?
You'll need to set android:targetSdkVersion="14" or higher within your AndroidManifest.xml to get rid of the "menu button of shame".
I'm building an android game that doesn't have an action bar. Even though I don't have an action bar, I still want the three vertical dots placed somewhere within my app. I'm not sure if I have to create my own image file that contains the dots, or if there's some way to move the dots in the layout manager in eclipse. Then when these dots are selected I want it to do the vertical drop down menu option like it does in the action bar.
Also I want the dots to disappear in android phones running under android 4.0, so that they can just use the normal menu button. Is this possible? It would be even better if I could get the three dots to trigger the menu in phones below 4.0 but I don't think that's possible so I'd rather just hide it entirely.
Thanks.
I'm not sure if I have to create my own image file that contains the dots
The standard overflow icon should be in your SDK.
or if there's some way to move the dots in the layout manager in eclipse
No.
Then when these dots are selected I want it to do the vertical drop down menu option like it does in the action bar.
You are welcome to implement your own PopupMenu for displaying a menu.
Also I want the dots to disappear in android phones running under android 4.0, so that they can just use the normal menu button
You are welcome to call setVisibility() on whatever you are using for your image whenever the mood strikes you. You will also need to arrange to display your own menu for MENU button presses.
IOW, you will need to roll your own menu system: displaying your trigger, displaying the menu based on the trigger, and doing something on menu choice selections. You are welcome to crib bits of this from the AppCompat action bar in the Android Support package, or perhaps ActionBarSherlock, if you wish.
It would be even better if I could get the three dots to trigger the menu in phones below 4.0
Since you are writing it all yourself, you are welcome to have it do whatever you want.
I want to make a action-bar drop-down-menu that shows items (icons) horizontally. Like this:
This is suppose to be a action-bar withe drop-down menu, where you can choose a color.
So it should show the icons (colors) horizontally and the icons should be clickable. Until now I have only managed to make a vertical list.
If possible I would like to do this in XML.
The ActionBar is not designed for such a use-case. The ActionBar buttons are meant to replace the old options menu that could be triggered with a separate hardware button on older devices (pre HC/ICS). The overflow button (the one with the 3 dots) that you've drawn in your sketch is used when there isn't enough room to show all buttons (the Android framework takes care of this automatically), so those will be grouped in the overflow menu. Overriding this behavior is a bad idea (if even possible).
Instead you should consider another approach: Add one ActionButton to the ActionBar that is meant to handle the color chooser. When this button is clicked the best solution is to show an AlertDialog (you can easily insert your on Views here that show the colors you want) because this will work best even if the button is hidden in the overflow menu.
Alternatively you could trigger a PopupMenu or implement some QuickAction to handle the color chooser (this will probably suck if your button is hidden in the overflow menu and will also lead to a very confusing UI).