Android-- 抽屉式公告

效果:

   ---->点击图标-->  

实现:只要用SlidingDrawer控件就可以做出点击图标,显示或隐藏内容,不需要再MainActivity上写任何代码,可以参考官网文档https://developer.android.google.cn/reference/android/widget/SlidingDrawer做更多的事

main.xml:

<SlidingDrawer
     android:id="@+id/drawer"
     android:layout_width="match_parent"
     android:layout_height="match_parent"

     android:handle="@+id/handle"
     android:content="@+id/content">

     <ImageView
         android:id="@id/handle"
         android:layout_width="88dip"
         android:layout_height="44dip" />

     <GridView
         android:id="@id/content"
         android:layout_width="match_parent"
         android:layout_height="match_parent" />

 </SlidingDrawer>


猜你喜欢

转载自blog.csdn.net/css33/article/details/80794032