0
나는보기가 있으며 화면의 위쪽과 아래쪽 위치를 가져와야합니다. 그래서 나는 다음과 같은 실험을 실행 : 가 알아 내려고 사각형, 내가 인쇄 그런 다음 실험보기의 직사각형을 얻는 방법
int[] location = { 0, 0 };
myView.getLocationOnScreen(location);
Rect outRect = new Rect();
myView.getHitRect(outRect);
을 실행 않습니다 쳐서
outRect.top = 18
outRect.bottom = 138
location[0] = 216
location[1] = 387
있어 내가이 일을
outRect.top
및
location[1]
를 기다리고 있었다 같은. 그래서
, 어떻게 내 직사각형 뷰의 상단과 하단의 위치를 어떻게해야합니까?
확인해보십시오. http://stackoverflow.com/questions/5730240/android-get-bounding-rectangle-of-a-view – Ranjit