android中关于SlidingDrawer类的解析

android.widget.SlidingDrawer

public class

SlidingDrawer(滑动抽屉)

extends ViewGroup
java.lang.Object
   ↳android.view.View
   ↳android.view.ViewGroup
   ↳android.widget.SlidingDrawer

Class Overview

SlidingDrawer hides content out of the screen and allows the user to drag a handle to bring the content on screen.

SlidingDrawer包含屏幕之外的内容,并且允许用户通过拖拉手柄把这些内容带到屏幕上面。

SlidingDrawer can be used vertically or horizontally.

SlidingDrawer可以设置为垂直或者水平状态。

A special widget composed of two children views: the handle, that the users drags, and the content, attached to the handle and dragged with it.

这个特殊的组件由两个子视图组成:用户用来拖拉的手柄及与手柄连接到一起并通过手柄拖拉出来的内容。

SlidingDrawer should be used as an overlay inside layouts.

SlidingDrawer应该用来做为内部布局的覆盖。

This means SlidingDrawer should only be used inside of a FrameLayout or a RelativeLayout for instance.

这意味着SlidingDrawer应该成为一个FrameLayout或者RelativeLayout的内部的一个实例。

The size of the SlidingDrawer defines how much space the content will occupy once slid out so SlidingDrawer should usually use match_parent for both its dimensions.

这个SlidingDrawer的尺寸决定了它包含的内容一旦滑出来占用了多少空间,因此SlidingDrawer应该通常把它的尺寸都设置为match_parent。

Inside an XML layout, SlidingDrawer must define the id of the handle and of the content:

在一个xml文件中,SlidingDrawer类必须定义手柄的id及内容的id,如下所示:

 <SlidingDrawer
     android:id="@+id/drawer"
     android:layout_width="match_parent"
     android:layout_height="match_parent"

     android:handle="@+id/handle"
     android:content="@+id/content">

     <ImageView
         android:id="@id/handle"
         android:layout_width="88dip"
         android:layout_height="44dip" />

     <GridView
         android:id="@id/content"
         android:layout_width="match_parent"
         android:layout_height="match_parent" />

 </SlidingDrawer>
 

Summary

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值