简体   繁体   中英

Can I make the background of the android application as group of images?

I need help in make the background of my app as gallery of photos... is that possible? and how to do that?

You can use a GridView to show images in column and row fashion. For more information you can take a look at this article for implementing gridview .

您可以通过为父级布局分配一个id来实现,然后在Java中,您可以在执行某些操作后更改背景图片。

You can use Asyymmetric Gridview to achive attractive view of gallery

you can use this library

Yes You can I did it before by creating an animation that contain the images then I set this animation as backgroud

        // Type casting the Image View
    ImageView view = (ImageView) findViewById(R.id.imageView1);

    // Setting animation_list.xml as the background of the image view
    view.setBackgroundResource(R.anim.animation);

    // Type casting the Animation drawable
    AnimationDrawable frameAnimation = (AnimationDrawable) view.getBackground();
    frameAnimation.start();

example animation xml:

    <?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false">
    <item android:drawable="@drawable/image_1" android:duration="3000" />
    <item android:drawable="@drawable/image_2" android:duration="3000" />
    <item android:drawable="@drawable/image_3" android:duration="3000" />   

</animation-list>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM