可以任意添加控件实现弧形排列 public class ArcMenuToolLayout extends RelativeLayout { private int[] viewsPerRadius; //每个字view的角度 public ArcMenuToolLayout(Context context) { super(context); } public ArcMenuToolLayout
public class ArcMenuToolLayout extends RelativeLayout { private int[] viewsPerRadius; //每个字view的角度 public ArcMenuToolLayout(Context context) { super(context); } public ArcMenuToolLayout(Context context, AttributeSet attrs) { super(context, attrs); } /** * 设置每个child的角度(若不设置则默认为平分后的中间角度) * @param viewsPerRadius */ public void setViewsPerRadius(int[] viewsPerRadius) { this.viewsPerRadius = viewsPerRadius; } @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { int count = getChildCount(); int perDegree = 90/count; int left; int top; int finalPerDegree; for (int i = 0;i