问题描述:

I want to develop a memory game; there will be 4x5 images in a grid. Let me show you an image.

But I need little bit animation. here I found a tutorial http://www.inter-fuser.com/2009/08/android-animations-3d-flip.html. I want this type animation.

But somehow I can't get how I can make it in a GridView.

Any kind of help are appreciated.

网友答案:

When using a GridView, the clicked View is provided in the onItemClick() callback.

Eg:

// mGridView is your GridView 
mGridView.setOnItemClickListener(new OnItemClickListener() {
    @Override
    public void onItemClick(AdapterView<?> parent, View v, int position,
            long id) {  
        // The View clicked on is v. Here you can call v.startAnimation();
    }
});

In order to achieve the Flip3dAnimation, linked to in your question, you must first implement the FrameLayout, described there, as your GridView items.

相关阅读:
Top