2012-06-18 4 views
1

동일한 페이지의 ID로 요소를 스크롤하는 예는 Google에서 훑어 보았지만 성공하지 못했습니다. 다음 예제를 통해 어떻게 수행 될지 궁금합니다.Android 동일한 페이지의 ID로 스크롤

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical" > 

    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" > 

    <Button 
     android:id="@+id/pressMe" 
     android:layout_height="wrap_content" 
     android:layout_width="wrap_content" 
     android:text="Press me to scroll to A"> 

    <ImageView 
     android:id="@+id/scrollToMe" 
     android:layout_height="100dp" 
     android:layout_width="fill_parent" 
     android:layout_marginTop="2000dp" 
     android:background="#f00"> 

    </LinearLayout> 

</ScrollView> 

답변

1

당신은 그 관점에 집중할 수 있습니다. 자동으로 그 관점을 볼 수 있습니다.

필자가 필요로하는 뷰의 좌표와 스크롤 할 수있는 좌표를 얻을 수 있다고 믿는다.

관련 문제