sachin pareek
sachin pareek

Reputation: 421

Dynamically add imageViews in a circular layout in Android

I want to add imageViews dynamically in a circle like a round plate. Android dose not provide a circular layout so please help me to create a circular layout.. Thanks in advance!

Upvotes: 1

Views: 951

Answers (4)

xresco
xresco

Reputation: 11

From your question I can see that you need a circular layout on Android to arrange your images. I think this library will help you doing this. this library gives you the ability to add item, rotate them with animation. Check it out!

Upvotes: 1

Nipun Gogia
Nipun Gogia

Reputation: 1856

Just check this out , this link shows how to make view in circular shape... just imlement your image view in it ...

http://developer.samsung.com/android/samples-4

or you can do this by xml :

<LinearLayout orientation=vertical for whole screen>
    <LinearLayout weight=1 gravity=center> <!--- Top --->
    </LinearLayout>
    <LinearLayout weight=1 orientation=horizontal> <!-- middle -->
        <LinearLayout weight=1 gravity=left/>
        <LinearLayout weight=1 gravity=right/>
    </LinearLayout>
    <LinearLayout weight=1> <!-- botton -->
        <LinearLayout weight=1 gravity=center/>
        <LinearLayout weight=1 gravity=center/>
    </LinearLayout>
</LinearLayout>

Upvotes: 1

nick.yu
nick.yu

Reputation: 99

You can use HorizontalScrollView.

Upvotes: 0

Anup Cowkur
Anup Cowkur

Reputation: 20563

You don't need a special layout for this.You can use a Relative Layout or a Frame Layout.

Just add the views dynamically in the normal way but position them using margin, padding etc so that they look like a circle.

Upvotes: 1

Related Questions