Custom menu in android
Is it possible to create a menu of开发者_StackOverflow社区 this type in android?
Not easily. That is specifically the J2ME style, 2-key menu for featurephones.
You COULD create your own ActionBar-style View that would have 2 buttons and tapping the button would bring up a Dialog; you would then position the Dialog's window so it looks like that. However it would have to be manually done and quite frankly would be a pain to get to look pretty and would be so different from any of the Android user-interface standards that I'm pretty sure you don't want to do that.
Of course it is possible. You just have to develop it from scratch. But I wouldn't recommend creating this menu, because it's not how most of the Android Apps look like and to create a good user experience it should fell like Android and not like an old Windows Mobile.
There are several ways to make such a menu. To make a View that looks like this, you will have to create a new xml layout file. The text boxes can be EditText objects, the buttons can be Button objects, etc. This site has an intro on how to begin.
I have created this type of menu. But I created a separate view as you have shown and in setContentview pass that view. See the following code. It will set the view when menu button is clicked.
@Override
public boolean onCreateOptionsMenu(android.view.Menu menu) {
setContentView(view)
return true;
}
Donot forget to vote me if my response is useful for you
Thanks Deepak
精彩评论