Android:在底部创建自定义菜单

Android:在底部创建自定义菜单

问题描述:

我想在屏幕底部创建一个自定义菜单,此菜单将作为按钮,并且始终始终是可见的,如果用户向下滚动,则它将可见,向上滚动.

I would like to create a custom made menu on the bottom of the screen, This menu will be as buttons and, it will always be visible first, if the user scrolls down, it will be visible, and scrolls upp.

这怎么可能?

此菜单始终可见吗?还是仅在按下菜单"按钮时出现?

Is this menu always visible? or does it only appear when the "menu" button is pressed?

执行此操作的一种简单方法是将RelativeLayout用作您的主要ViewGroup.创建第二个包含菜单项的ViewGroup(LinearLayout,RelativeLayout ...或其他),并将整个组锚定到屏幕底部.如果要这样做,则将ListView放在第二个组的上方,它将占据菜单控件上方的所有空间,并且菜单控件本身始终是可见的.

An easy way to do this is to use a RelativeLayout as your main ViewGroup. Create a second ViewGroup (LinearLayout, RelativeLayout... or whatever) that contains your menu items and anchor the whole group to the bottom of the screen. If you were to then, put a ListView above that second group it would occupy all the space above your menu controls and the menu controls themselves would always be visible.

希望是有帮助的.