Android Apps 滑动式抽屉(SlidingDrawer)效果
来源:互联网 发布:域名申请费用 编辑:程序博客网 时间:2024/04/29 10:31
button = (Button) findViewById(R.id.button);handle = (Button) findViewById(R.id.handle);handle1 = (Button) findViewById(R.id.handle1);sd = (SlidingDrawer) findViewById(R.id.slidingdrawer);button.setOnClickListener(new OnClickListener() {@Overridepublic void onClick(View v) { sd.animateClose();}}); handle1.setOnClickListener(new OnClickListener() {@Overridepublic void onClick(View v) { sd.animateOpen();}});
下午有两个布局,实现不同的效果
===========================================================================
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/stephy"><Button android:id="@+id/handle1" android:layout_width="100dp" android:background="#a5f871"android:layout_height="30dp" android:text="CLICK"/> <SlidingDrawer android:id="@+id/slidingdrawer" android:layout_alignParentBottom="true" android:layout_width="fill_parent" android:layout_height="130dp" android:orientation="vertical" android:handle="@+id/handle" android:content="@+id/content" android:bottomOffset="0px"> <Button android:id="@+id/handle" android:layout_width="100dp" android:layout_height="30dp" android:background="#a5f871" android:text="DRAWER"/> <LinearLayout android:id="@+id/content" android:layout_width="fill_parent" android:layout_height="100dp" android:background="#dcf88e" android:gravity="center_vertical|center"> <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="100dp" android:text="Button" android:background="#3356e7"/> <EditText android:id="@+id/editText" android:layout_width="fill_parent" android:layout_height="80dp"/> </LinearLayout></SlidingDrawer></RelativeLayout>
============================================================================
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/stephy"><Button android:id="@+id/handle1" android:layout_width="100dp" android:background="#a5f871"android:layout_height="30dp" android:text="CLICK"/> <SlidingDrawer android:id="@+id/slidingdrawer" android:layout_alignParentBottom="true" android:layout_width="fill_parent" android:layout_height="130dp" android:orientation="vertical" android:handle="@+id/handle" android:content="@+id/content" android:bottomOffset="0px"> <Button android:id="@+id/handle" android:layout_width="100dp" android:layout_height="30dp" android:background="#a5f871" android:text="DRAWER"/> <LinearLayout android:id="@+id/content" android:layout_width="fill_parent" android:layout_height="100dp" android:background="#dcf88e" android:gravity="center_vertical|center"> <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="100dp" android:text="Button" android:background="#3356e7"/> <EditText android:id="@+id/editText" android:layout_width="fill_parent" android:layout_height="80dp"/> </LinearLayout></SlidingDrawer></RelativeLayout>
备注:
SlidingDrawer的属性
android:allowSingleTap: 指示是否可通过单击handle打开或关闭(如果是false,刚用户必须通过拖动,滑动或者使用轨迹球,来打开/关闭抽屉。)默认的是true。
android:animateOnClick: 指示当用户点击handle的时候,抽屉是否以动画的形式打开或关闭。默认的是true。
备注:
SlidingDrawer的属性
android:allowSingleTap: 指示是否可通过单击handle打开或关闭(如果是false,刚用户必须通过拖动,滑动或者使用轨迹球,来打开/关闭抽屉。)默认的是true。
android:animateOnClick: 指示当用户点击handle的时候,抽屉是否以动画的形式打开或关闭。默认的是true。
- Android Apps 滑动式抽屉(SlidingDrawer)效果
- Android SlidingDrawer 滑动抽屉效果
- 滑动式抽屉(SlidingDrawer)
- android SlidingDrawer滑动式抽屉控件
- Android开发之SlidingDrawer(滑动式抽屉)
- Android SlidingDrawer(滑动式抽屉)
- Android UI, GridView, ScrollView, SlidingDrawer 抽屉滑动效果
- Android之SlidingDrawer滑动抽屉
- Android中SlidingDrawer(滑动式抽屉)效果源码 (十四)
- Android之SlidingDrawer抽屉效果
- Android之SlidingDrawer抽屉效果
- android 抽屉效果 (SlidingDrawer)
- SlidingDrawer(滑动式抽屉)
- 自定义SlidingDrawer抽屉式效果和SlidingDrawer抽屉式效果
- Android控件之SlidingDrawer(滑动式抽屉)
- Android进阶2之SlidingDrawer(滑动式抽屉)
- Android控件之SlidingDrawer(滑动式抽屉)
- Android控件之SlidingDrawer(滑动式抽屉)
- 自制鼠标自动点击器
- SAP ScriptForms 教程系列六
- 获得字符串长度(双字节的汉字按2计算)
- action控制层,使用spring注解方式注入业务bean报空指向错误
- Printf()输出格式控制
- Android Apps 滑动式抽屉(SlidingDrawer)效果
- 西万路上 人们又开始堵路解决问题了
- 项目管理实战之团队管理
- Ubuntu下Ibus输入法设置
- jsp中的日期问题及其它
- tslib android 参考帖
- 蓝牙(Bluetooth)系统的无线接入
- 聚集索引非聚集索引使用条件
- NSString和NSDate对象之间的相互转换