实现如下图效果:

其中抽屉xml为:

注意这个一定要设置的比你屏幕长 要不就会就不是单行显示了

android:layout_width="1100dp"

<SlidingDrawer android:id="@+id/slidingdrawer"android:layout_alignParentBottom="true" android:layout_width="wrap_content"android:layout_below="@id/widget31" android:layout_height="180px"android:orientation="horizontal" android:handle="@+id/handle"android:content="@+id/content"><ImageButton android:id="@+id/handle"android:layout_width="wrap_content" android:layout_height="wrap_content"    android:background="@drawable/drag" /><HorizontalScrollView android:id="@+id/content"android:layout_width="fill_parent" android:layout_height="fill_parent"android:scrollbars="none" android:layout_marginTop="10dip"><FrameLayout android:layout_width="fill_parent"android:layout_height="fill_parent"><LinearLayout android:layout_width="1100dp"android:layout_gravity="center_vertical" android:layout_height="fill_parent"android:orientation="horizontal" android:layout_marginTop="5dip"><GridView android:id="@+id/mDiviceListContainer"android:layout_width="fill_parent" android:layout_gravity="center_vertical"android:layout_height="wrap_content" android:horizontalSpacing="10.0px"android:verticalSpacing="1.0px" android:stretchMode="none"android:numColumns="auto_fit" android:columnWidth="150px"></GridView></LinearLayout></FrameLayout></HorizontalScrollView></SlidingDrawer>


GridView 中adapter的xml:

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent" android:layout_height="fill_parent"android:id="@+id/childlayout" android:orientation="horizontal"><RelativeLayout android:layout_width="wrap_content"android:id="@+id/backgroundImage" android:background="@drawable/tv"android:gravity="center" android:layout_height="wrap_content"><TextView android:id="@+id/devicename" android:layout_width="wrap_content"android:layout_height="wrap_content" /></RelativeLayout></RelativeLayout>


更多相关文章

  1. Android中设置屏幕全屏两种方法:
  2. android launcher2开发之 有抽屉改成无抽屉
  3. Android屏幕分辨率正确获取及PX,DPI,DP,SP等的对应关系
  4. Android系统配置数据库注释(settings.db)
  5. android 分辨率及密度详细
  6. Android屏幕常亮
  7. Android(安卓)屏幕设置
  8. android调用setRequestedOrientation之后
  9. android支持多行的radiogroup

随机推荐

  1. android 获得屏幕宽和高
  2. android NFC
  3. Android 短信备份完整版
  4. [Android Pro] proguard.cfg 配置文件
  5. android 开发之Activity切换
  6. QQ上的tabhost效果
  7. android软键盘开关
  8. Android与服务器通信的方法之一-->TCP
  9. android 项目练习:自己的词典app——生词
  10. android实现自动提示功能