android 抽屉效果,内容GridView来实现单行滑动
2011-10-18 22:02
633 查看
实现如下图效果:
其中抽屉xml为:
注意这个一定要设置的比你屏幕长 要不就会就不是单行显示了
android:layout_width="1100dp"
GridView 中adapter的xml:
其中抽屉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>
相关文章推荐
- Android ViewPager内容部分随手势上下滑动隐藏与显示Indicator效果的实现
- Android HorizontalScrollView结合GridView实现类似网易新闻那样的栏目滑动效果
- Android ViewPager内容部分随手势上下滑动隐藏与显示Indicator效果的实现
- 【小功能4】android用SlidingDrawer实现抽拉的滑动效果(也叫抽屉)附源码
- android 单行gridview横向滑动的实现
- Android UI, GridView, ScrollView, SlidingDrawer 抽屉滑动效果
- Android编程滑动效果之Gallery+GridView实现图片预览功能(附demo源码下载)
- Android使用CoordinatorLayout和BottomSheetBehavior实现滑动效果(底部抽屉)
- Android ViewPager内容部分随手势上下滑动隐藏与显示Indicator效果的实现
- ANDROID GridView 分页平滑滑动 效果的实现(基于android TV遥控器操作)
- android开发之&使用ViewPager加gridView实现菜单按钮分页滑动(类似QQ表情选择翻页效果)
- Android UI实现单行文本水平触摸滑动效果
- android ViewDragHelper 实现抽屉滑动效果
- Android 抽屉效果的导航菜单实现
- Android实现GridView中的item自由拖动效果
- 【转】Android 使用Scroller实现绚丽的ListView左右滑动删除Item效果
- Android Listview分组特效:滑动分组标题当前固定,并随内容滑动(andrroid原生电话本实现方法)
- Android 可拖拽的GridView效果实现, 长按可拖拽和item实时交换
- Android实现滑动到顶部悬停的效果
- Android控件之RatingBar(类似淘宝实现滑动星级评价效果)