3

ユーザーがボタンをクリックしたときに膨張するビューがあり、ボタンがクリックされたときにビューを画面にアニメーション表示したいのですが、以下のコードを試しましたが、ビューはアニメーションではなく画面にスナップするだけです画面。ビューが位置にアニメーション化されない理由がわかりません。私がアニメーション化したいビューはpreviewMemberPanel

 previewMemberPanel = ((LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE))
            .inflate(R.layout.main_member_listing_imagepreview, null, false);

 //button click body
    Animation anim = new TranslateAnimation(new DisplayMetrics().widthPixels / 2, 0, 0, 0);
    anim.setFillAfter(true);
    anim.setDuration(5000);
    anim.setStartOffset(500);
    if( !previewMemberPanel.isShown() ){
        ((LinearLayout) findViewById(R.id.rootMembers)).addView(previewMemberPanel);          
      previewMemberPanel.startAnimation(anim);
    }
4

1 に答える 1