Android SlidingDrawer 使用方法
我已经看过很多地方,但我找不到关于如何为我的应用程序制作 SlidingDrawer 的像样的教程。
假设我已经有一个 XML 文件,并且我想向其中添加一个滑动抽屉...我还想添加一个 textview 和 listview 对象,以及其中的一些按钮...我该怎么做?
任何帮助将不胜感激!
I've looked in many places, but I cant find a decent tutorial on how to make a SlidingDrawer for my application.
Say i already have an XML file, and i want to add a sliding drawer to it..i also want to add a textview and listview object, and some buttons in it...how would i go about doing that?
Any help will be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个
SlidingDrawer
示例应用。特别是,这是布局:现在,在本例中,整个活动只是一个
SlidingDrawer
。这是相对不寻常的——这个示例很短,因为它来自一本书。更常见的是,我希望您将
SlidingDrawer
作为RelativeLayout
的子级,这样您就可以拥有RelativeLayout
的其他子级并拥有打开时抽屉滑过它们的顶部。我相信在这种情况下,您需要将SlidingDrawer
作为RelativeLayout
的最后一个子级。Here is a
SlidingDrawer
sample app. In particular, here is the layout:Now, in this case, the whole activity is just a
SlidingDrawer
. That's relatively unusual -- this sample is short because it is from a book.More commonly, I would expect you to put a
SlidingDrawer
as a child of aRelativeLayout
, so you can have other children of theRelativeLayout
and have the drawer slide over top of them when opened. I believe you will need theSlidingDrawer
to be the last child of theRelativeLayout
in this case.