在相同的布局滑动抽屉 [英] Sliding drawer in the same layout
问题描述
你知道如何来达到同样的效果,AOL的Winamp为Android?我想要做类似的事情。那是当我点击列表视图,滑动抽屉弹出。但到目前为止,我只可以显示新的活动滑动抽屉不一样的。
Do you know how to achieve the same effect as winamp for android ? I want to do the similar thing. That is when I click on listview, sliding drawer popup. But so far I only can show the sliding drawer in new activity not in the same.
我怎样才能实现重叠视图。这时候,我关上抽屉,布局展现在面前,而滑动手柄上的布局,当我打开抽屉,它涵盖了主要的布局。
How can I achieve in overlap view. That is when I close the drawer, the layout is show at the front, and the sliding handle is on the layout, when I open the drawer, it covers the main layout.
任何有关的想法?
谢谢!
推荐答案
步骤#1:创建一个 RelativeLayout的
第二步:把你的用户界面的其他部分的 RelativeLayout的
Step #2: Put the rest of your UI in the RelativeLayout
第三步:把 SlidingDrawer
在 RelativeLayout的
为以后的孩子则UI的其余部分(例如,在布局XML,它作为最后一个子元素的 RelativeLayout的
)
Step #3: Put the SlidingDrawer
in the RelativeLayout
as a later child then the rest of the UI (e.g., in layout XML, have it as the last child element of the RelativeLayout
)
RelativeLayout的
的儿童(和的FrameLayout
)堆叠在另一个上的Z轴的上方(即在屏幕的面)。因此,后面的孩子将重叠较早的。通过将你的 SlidingDrawer
最后,将重叠一切打开的时候。
Children of RelativeLayout
(and FrameLayout
) stack on top of one another on the Z-axis (i.e., out the face of the screen). Hence, later children will overlap earlier ones. By putting your SlidingDrawer
last, it will overlap everything else when opened.
这篇关于在相同的布局滑动抽屉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!