效果:

Android-- 抽屉式公告   ---->点击图标-->   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>


相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
  • 2021-12-01
  • 2021-04-12
  • 2021-04-21
  • 2021-08-03
猜你喜欢
  • 2021-08-18
  • 2021-06-03
  • 2021-10-05
  • 2022-12-23
  • 2021-10-02
相关资源
相似解决方案