1

谁能告诉我如何在 onLayout() 中动态更改数据。我想显示前 8 个值,然后旋转完成另外 8 个值,直到它显示数组限制。这是我的代码-

if (position < conversion.length) {

                if (!childRotate) {
                    child.setAngle(angle);
                    child.setPosition(i);
                    position = i;
                    child.setImageResource(conversion[position]);
                    Float an = angle;
                    Log.i("prj,=angle", an.toString() + ",i=" + i.toString()
                            + ",onlayout,position=" + position.toString());
                    position++;

                } else {

                    child.setAngle(angle);
                    child.setPosition(i);
                    child.setImageResource(conversion[position]);
                    Float an = angle;
                    Log.i("prj,angle=", an.toString() + ",i=" + i.toString()
                            + ",onlayout,position=" + position.toString());
                    position++;
                    // childRotate = false;

                }
            }
            left = Math
                    .round((float) (((layoutWidth / 2) - childWidth / 2) + radius
                            * Math.cos(Math.toRadians(angle))));
            top = Math
                    .round((float) (((layoutHeight / 2) - childHeight / 2) + radius
                            * Math.sin(Math.toRadians(angle))));

            child.layout(left, top, left + childWidth, top + childHeight);
            angle += angleDelay;
4

0 回答 0