Android - 使滑动抽屉从左向右滑动 [英] Android - Making Sliding Drawer to slide from Left-to-Right

查看:33
本文介绍了Android - 使滑动抽屉从左向右滑动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下 XML 布局在我的应用程序中实现了滑动抽屉":(我从 androidpeople.com 得到这个例子)

I have implemented "Sliding Drawer" in my application using the below XML layout: (I got this example from androidpeople.com)

<LinearLayout android:id="@+id/LinearLayout01"
 android:layout_width="fill_parent" android:layout_height="fill_parent"
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:background="@drawable/androidpeople">

 <SlidingDrawer 
  android:layout_width="wrap_content" 
  android:id="@+id/SlidingDrawer" 
  android:handle="@+id/slideHandleButton" 
  android:content="@+id/contentLayout" 
  android:layout_height="75dip"
  android:orientation="horizontal">

  <Button 
   android:layout_width="wrap_content" 
   android:layout_height="wrap_content" 
   android:id="@+id/slideHandleButton" 
   android:background="@drawable/closearrow">
  </Button>

  <LinearLayout 
   android:layout_width="wrap_content" 
   android:id="@+id/contentLayout" 
   android:orientation="horizontal" 
   android:gravity="center|top" 
   android:padding="10dip" 
   android:background="#C0C0C0" 
   android:layout_height="wrap_content">


   <Button android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Content"></Button>
   <Button android:id="@+id/Button02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Content"></Button>
   <Button android:id="@+id/Button03" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Content"></Button>

  </LinearLayout>

 </SlidingDrawer>
</LinearLayout>

但我想要的是从左到右(水平)而不是从右到左滑动抽屉,我如何让滑动抽屉从左到右方向滑动?

but what I am wanting is to Slide the drawer from Left-to-right(Horizontal) instead of this right-to-left, how do i make slide drawer to slide from left-to-right direction?

请与我分享您的想法/观点/意见/问题,让我摆脱这个问题.

Please share your idea/view/opinion/issue with me and catch me out of this problem.

推荐答案

这里有一个教程:link

滑动抽屉好像没有定位,找不到sdk提供的布局属性.但是就像在上面的教程中一样,您可以编写自己的滑动抽屉小部件并应用布局属性来定位滑块/面板.

It seems that there is no positioning for sliding drawer, I can not find any layout attributes provided by the sdk. But like in the tutorial above you could write your own sliding drawer widget and apply layout attributes to position the slider/panel.

您可以查看https://github.com/umano/AndroidSlidingUpPanel

这篇关于Android - 使滑动抽屉从左向右滑动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆