i have a textview at the bottom of my screen but when menu clicked, i need to move the textview just above the menu, so that every one can see the textview,now when i clicked menu ,it cover the textview ,any solution for this problem
This is only possible with the virtual keyboard, I think.
It would not be a good idea anyway, since menus are for things the user can decide to do without looking at the screen information. Menus should be self-explaining.
A dialog is another story, since it sometimes refers to items, which are covered by it (open file e.g.). One might want to repeat the item in the dialog. I would not use a menu to open a file, the user has selected from a view. Instead, I would use a popup dialog, repeating the file name.
Related
I am working on a simple application that is supposed to work on 800x480 tablet. Currently:
[][][][]
[][][][]
OOO
These are all buttons and they are working as expected. I, however, need to add menu items to the bottom-buttons. When clicked, menu items should pop up.
-Can I create a menu and place it at the bottom of the screen to replace those buttons? If so, could you show an example, cause I couldn't find any.
-Or, can I add menu items to these buttons?
What You want is an OptionsMenu, if I understand You the right way. I could give You an example later, I am not at home. But for now, look at this example. If You follow this, You donĀ“t need those buttons at the bottom.
http://www.edumobile.org/android/android-beginner-tutorials/options-menu/
if it is not clear, just let me know and I try to give You an example at the evening...
EDIT
for custom menu, You could use PopUpMenu. I had not tried this for now, but I think it is a good solution
http://android-er.blogspot.de/2012/03/example-of-using-popupmenu.html
I have an Activity which provides UI for editing entity properties such as name, description an so on. This entity can also have an icon but (this is the main problem) can have no icon. I have created an icon picker activity which provides UI for icon selection. But I can not think of a simple and pretty way to provide access to this picker from parent activity. It could be a simple image button if the task was just to select an icon but I have also to make it possible to remove already set icon. Having two buttons with 'choose' and 'remove' seems ugly. Any smart ideas?
UPDATE
I've ended with ImageButton showing selected icon or special 'No' icon if object has no icon. On button click I show PopupMenu on 3.0+ and ContextMenu on older versions. Menu contains 'Change' and 'Remove' items.
You could have a border that surrounds an empty space or the image if there is one already.
If the image exists, clicking on it brings up a dialog where you can choose to change it or remove it.
If it doesn't exist, clicking on it brings up a dialog where you can add it.
how about a gridview within a custom dialog fired from your parent activity??
change the icon onItemSelected() of the gridview??
When my app is first run, I would like to have a welcome message displayed in a dialog box. Then the user can click next at the bottom, and the box stays but a new layout is displayed where the user can input information.
How would I go about this? It would also be great if I was able to add an animation between the two layouts, the second one sliding in from the right for example. Is this possible?
I was thinking I may be able to use
builder.setView(secondlayout);
In my application I am having 3 menu like options,setting and favorites. In that If I press 'favorites' means it should display another set of (new)menu and I want to hide the previous set of (old)menu. IS it possible with android? If anyone knows, help me please.
I'm not sure if this is possible, but it's not the bast idea to do such things. Main reason - this behavior will be unexpected for user.
On selecting option menu item you should show alert dialog with possible choices.
Offtopic: According new design guidelines Android will delete "menu button", and all actions will appear on action bar. May be this will be better for your purposes.
I have a button that says "Sort" and when a user normal/short presses the button, I want a menu to appear with the various sort options. Looking around online there doesn't seem to be a straight forward answer to which route is considered best practice. I'm looking to have a menu that looks similar to this:
with icons and text.
For an example, click the Layers button in the Google Maps app. It opens a list of options on a single short click. It has a title at the top and icons for each option. (The icons aren't super crucial)
Should I use a Context Menu? If so, how do I do it without a long press. Should it be a Spinner? If so how do I change the appearance to use a button instead of the normal drop down box.
Spinners are for stateful selection, which sounds like what you want here. The user will select one sort option from a list, and there is a concept of a "current" sort that stays visible to the user.
For something like the activity picker in your screenshot, Falmarri's suggestion of an AlertDialog is reasonable. The difference between choosing a sort and the activity picker is the "stateful selection" distinction. Spinners have a concept of a currently selected item already provided for you, dialogs are more general.
http://developer.android.com/reference/android/app/AlertDialog.html