开发者

Gallery Selected Position Animation

开发者 https://www.devze.com 2023-04-04 22:58 出处:网络
am trying to use this myGallery.setSelection(5, true); (Gallery.setSelection(Position, Animate);), which 5 is the requested position.

am trying to use this myGallery.setSelection(5, true); (Gallery.setSelection(Position, Animate);), which 5 is the requested position.

should this method animate the gallery till th开发者_StackOverflow中文版e new selected position is shown?? or just jumps to the selected position directly?

because when i use it, no animation happens !!


set animation for on item selected listener. The animation will call only for selected gallery item.

myGallery.setOnItemSelectedListener(new OnItemSelectedListener(){
    @Override
    public void onItemSelected(AdapterView<?> arg0, View arg1,int arg2, long arg3) {
        arg1.setAnimation(AnimationUtils.loadAnimation(this, R.anim.scale_img));
    }
});

this will help you.

0

精彩评论

暂无评论...
验证码 换一张
取 消