Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
637 views
in Technique[技术] by (71.8m points)

xml - creating a Circular view in android

I am trying to create a view where the icons are placed in the circular view rather then the existing view like grid or the gallery view. I tried with Carousel example but later on found that it will not meet my requirement because its 3D app, but i am looking for 2D View.Android 3D Carousel

This is the example that I was following. I was able to get the circular kind of thing but to meet my requirement I should stick with 2D.

My one more major requirement is inside circular view I must also have another circular view, something like below figureenter image description here

Can anyone help me out in this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

For the layout of each circle I suggest this answer to question layout with buttons in a circle because it defines your item positions relative to the center of the enclosing RelativeLayout regardless of its size. You can then overlay the two circle layouts thus:

<RelativeLayout ...>
    <RelativeLayout // outer circle
        android:layout_alignParentCenter>
        ...
    </RelativeLayout>
    <RelativeLayout // inner circle
        android:layout_alignParentCenter>
        ...
    </RelativeLayout>
</RelativeLayout>

To rotate each of the circles independently, I suggest following this answer to question **Rotate View Hierarchy 90 Degrees".


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.8k users

...