layout like spider

前端 未结 2 1711
刺人心
刺人心 2021-01-13 19:42

I want a cylindrical, spider web like layout:

\"\"

I know that I can use canvas to draw this but I also

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-13 20:16

    I am not sure but i hope this can help you ...

    The Path class holds a set of vector-drawing commands such as lines, rectangles, and curves. Here’s an example that defines a circular path:

    circle = new Path();
    circle.addCircle(150, 150, 100, Direction.CW);
    

    This defines a circle at position x=150, y=150, with a radius of 100 pixels. Now that we’ve defined the path, let’s use it to draw the circle’s outline plus some text around the inside:

    private static final String QUOTE = "Now is the time for all " +
    "good men to come to the aid of their country." ;
    canvas.drawPath(circle, cPaint);
    canvas.drawTextOnPath(QUOTE, circle, 0, 20, tPaint);
    

    You can see the result in this Figure

    This is figure

    If you want to get really fancy, Android provides a number of PathEffect classes that let you do things such as apply a random permutation to a path, cause all the line segments along a path to be smoothed out with curves or broken up into segments, and create other effects.

提交回复
热议问题