SliderDraw 简单使用

SliderDraw 的关键是理解3点:

1:handle: 点击的按钮

2:content:展开的内容

3:SliderDraw不是一个独立控件,而只能作为2级控件来使用,即它外面必须再包一个view(layout)来控制大小,而它本身必须是充满这个父view的。

 

主要工作在XML里面:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<ImageView 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:src = "@drawable/backup"
    />
   
   
   
 <RelativeLayout 
    android:layout_alignParentRight = "true"
   
    android:layout_width="100dp"
    android:layout_height="fill_parent"
    >  
<SlidingDrawer
   android:id="@+id/drawer1"
   
   android:layout_width = "wrap_content"
   android:layout_height = "fill_parent"
   android:handle = "@+id/myimage1"
   android:content = "@+id/content1" 
   android:orientation="horizontal"
  




<ImageView
    android:id="@id/myimage1"
    android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:src = "@drawable/open"
  
  
/>


    
 
 <GridView
     android:id="@id/content1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:numColumns="1"
    android:background = "#80808080"
 
 />
 
 

 
 </SlidingDrawer>
</RelativeLayout>   
   
</RelativeLayout>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章