最近试着做了个安卓带有弹出收缩动画的扇形菜单,留个笔记记录一下。
<>强效果如下强>
公共类MainActivity AppCompatActivity延伸实现视图。OnClickListener { 私人ImageView imgPublish; 私人TextView textView1; 私人TextView textView2; 私人布尔isMenuOpen=false; 私人List,两个=new ArrayList<的在(); @Override 保护空白> & lt; & # 63; xml version=" 1.0 " encoding=" utf - 8 " & # 63;比; & lt; FrameLayout xmlns: android=" http://schemas.android.com/apk/res/android " xmlns:工具=" http://schemas.android.com/tools " android: layout_width=" match_parent " android: layout_height=" match_parent " 工具:上下文=癱om.example.lina.animationapplication.MainActivity”比; & lt; TextView android: id=癅 + id/tv_1” android: layout_width=" 40 dp " android: layout_height=" 40 dp " android: layout_gravity="底部|结束" android: layout_marginBottom=" 40 dp " android: layout_marginRight=" 40 dp " android:重力="中心" android:文本="标题1” android:输入textColor=" # ffffff " android:可见性="了" android:背景=" @drawable/circle_purple”/比; & lt; TextView android: id=癅 + id/tv_2” android: layout_width=" 40 dp " android: layout_height=" 40 dp " android: layout_gravity="底部|结束" android: layout_marginBottom=" 40 dp " android: layout_marginRight=" 40 dp " android:重力="中心" android:文本="标题2” android:输入textColor=" # ffffff " android:可见性="了" android:背景=癅drawable/circle_orange”/比; & lt; ImageView android: id=癅 + id/img_publish” android: layout_width=" 60 dp " android: layout_height=" 60 dp " android: layout_gravity="底部|结束" android: layout_marginBottom=" 35 dp” android: layout_marginRight=" 35 dp” android: src=" https://www.yisu.com/zixun/@mipmap fabu "/比; & lt;/FrameLayout> >之前 circle_purple.xml
& lt; & # 63; xml version=" 1.0 " encoding=" utf - 8 " & # 63;比; & lt;形状xmlns: android=" http://schemas.android.com/apk/res/android " android:形状=巴衷病北? & lt;固体android:颜色=" # 5 d2a89 "/比; & lt;/shape> >之前<强>参考强>
Android开罐头- - -快速打造扇形卫星菜单
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
Android带有弹出收缩动画的扇形菜单实例