zoukankan      html  css  js  c++  java
  • Android 抽屉类SlidingDrawer的使用

     比较简单,设置好SlidingDrawer控件的handle和content属性就可以了。
     android:content="@+id/content"
     android:handle="@+id/handle" 就可以了。效果如下图:
    抽屉没打开的时候。
     
    从下往上托Handle按钮,打开抽屉

    代码如下:
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#808080"
        tools:context=".MainActivity" >
    
        <SlidingDrawer
            android:id="@+id/slidingdrawer"
            android:layout_width="fill_parent"
            android:layout_height="300dp"
            android:content="@+id/content"
            android:handle="@+id/handle"
            android:orientation="vertical" >
    
            <Button
                android:id="@+id/handle"
                android:layout_width="88dip"
                android:layout_height="44dip" 
                android:text="Handle">
                
            </Button>
    
            <LinearLayout
                android:id="@+id/content"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:background="#00ff00" >
    
                <Button
                    android:id="@+id/button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Pls Input:" />
    
                <EditText
                    android:id="@+id/editText"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content" />
            </LinearLayout>
        </SlidingDrawer>
    
    </RelativeLayout>
    

      这里做的比较简单,当然你可以做的更美观。

     
     
  • 相关阅读:
    设计模式JS中的单例模式应用(一)
    SSD5_ Exercise 4分析
    JavaEE学习笔记
    SSD5_Exercise5分析
    SSD5_Optional Exercise6分析
    ACM相关网站
    hdu 2066 一个人的旅行【Dijkstra 12级新生训练—图论E】
    新队员图论基础_【CSUST_12级训练】
    hdu 2112 Today【F map + Floyd 入门训练】
    turtle库笔记
  • 原文地址:https://www.cnblogs.com/linlf03/p/3376191.html
Copyright © 2011-2022 走看看