1
ScaleAnimation
을 사용하여 ImageView
의 크기를 조정했습니다. 그러나 애니메이션이 완료된 후 어떻게 내 ImageView
의 치수 또는 비트 맵을 얻을 수 있습니까?ScaleAnimation 후에 View의 새로운 너비와 높이를 얻는 방법
ScaleAnimation animation = new ScaleAnimation(m_oldZoomRatio, m_currentZoomRatio, m_oldZoomRatio, m_currentZoomRatio);
animation.setFillAfter(true);
animation.setFillEnabled(true);
animation.setAnimationListener(new AnimationListener() {
public void onAnimationStart(Animation animation) {
}
public void onAnimationRepeat(Animation animation) {
}
public void onAnimationEnd(Animation animation) {
}
});
m_child.startAnimation(animation);
m_oldZoomRatio != m_currentZoomRatio
: 덕분에 여기
내보기가 실행되는 동안 레이아웃이 변경되는 것을 볼 수 있습니다. 그러나 너비와 높이를 가져올 때보기를 만들 때 원래 값을받습니다.
감사를 변경할 수 있습니다 애니메이션 리스너를 사용하려고합니다. 하지만 내 문제는 차원을 얻는 것입니다 (제안대로 설정하지 않는 것). – ndphu
getHeight(), getWidth() 함수를 사용할 수있는 치수를 얻으려면 ... 그냥 대답 – Maneesh
에서 편집 해 주셔서 감사합니다. 하지만 둘 다 ScaleAnimation 전에 뷰의 원래 치수를 반환합니다 (그러나 화면에서 ImageView의 크기가 이미 변경됨). – ndphu