Здравствуйте. Есть
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:onClick="onClick10" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
<ScrollView
android:id="@+id/scrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:padding="10dip">
<TextView
android:id="@+id/about_content"
android:layout_width="wrap_content"
android:layout_height="1856dp"
android:text="@string/about_text" />
</ScrollView>
</LinearLayout>
и
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about);
openFile(FILENAME);
SV = (ScrollView) findViewById(R.id.scrollView);
SV2 = (TextView) findViewById(R.id.about_content);
setScrolY(345);
}
public void setScrolY(int nnn) {
SV.setScrollY(nnn);
}
Нужно что бы при открытии активности текст в ScrollView
не помещающийся в экран(Книга), переходил по Y-ку в определенное место,но больше чем примерно на 30 пикселей не переходит, хотя getScrollY
работает корректно. И этот же setScroll(nnn)
; тоже работает корректно если делать из кнопки
public void onClick10(View v) {
SV.setScrollY(nnn);
}
Помогите сделать переход по тексту при открытии активности.