论坛首页 移动开发技术论坛

Android Launcher抽屉类(SlidingDrawer)的使用

浏览 3127 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2011-12-27  
最近在网上看帖子的时候,看见有人提到了Launcher涉及的抽屉类SlidingDrawer,查阅相关资料写了一个简单的Demo,供大家参考,有什么不足之处,希望和大家交流!有更好的想法可以再后面跟帖,大家互相讨论!

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:background="#808080">
<SlidingDrawer 
    android:id="@+id/sliding_drawer"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:handle="@+id/handle"
    android:content="@+id/content"
    >
    <Button 
        android:id="@+id/handle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/handle"
        />
    <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="Button"
            />
        <EditText 
            android:id="@+id/editText"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"            
            />
    </LinearLayout>
</SlidingDrawer>
</LinearLayout>


备注:SlidingDrawer中handler就是点击的监听器,content为显示的内容界面


论坛首页 移动开发技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics