文章目录
  1. 1.
  2. 2. 用法

仿Path带动画效果的扇形菜单

用法

1
2
3
4
5
6
7
8
9
ArcMenu menu = (ArcMenu) findViewById(R.id.arc_menu);
final int itemCount = ITEM_DRAWABLES.length;
for (int i = 0; i < itemCount; i++) {
ImageView item = new ImageView(this);
item.setImageResource(ITEM_DRAWABLES[i]);
menu.addItem(item,new OnClick(View v){
Toast.makeText(MainActivity.this, "position:" + position, Toast.LENGTH_SHORT).show();
});
}

改变外观可以在xml中

1
2
3
custom:childSize="50px"
custom:fromDegrees="0.0"
custom:toDegrees="300.0"

或者在java中

1
2
arcLayout.setChildSize(50);
arcLayout.setArc(0.0f,300.0f);


ArcMenu

文章目录
  1. 1.
  2. 2. 用法