to przykład XMLJak zapobiegać innych Zobacz pchanych z ekranu
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content" android:orientation="vertical"
android:layout_margin="5dip" android:background="#FF992222">
<ScrollView android:layout_height="wrap_content"
android:layout_width="fill_parent">
<LinearLayout android:layout_height="wrap_content"
android:orientation="vertical" android:layout_width="fill_parent">
<TextView android:layout_width="wrap_content" android:text="TextView"
android:layout_height="wrap_content" android:textSize="24dip"></TextView>
</LinearLayout>
</ScrollView>
</LinearLayout>
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content" android:orientation="vertical"
android:layout_margin="5dip" android:background="#FF555555">
<TextView android:layout_width="wrap_content" android:text="TextView"
android:layout_height="wrap_content" android:textSize="24dip"></TextView>
</LinearLayout>
</LinearLayout>
Rezultatem jest tak:
Jeśli zauważysz, tekst w górnej LinerLayout są zapakowane w LinearLayout i ScrollView.
Jeżeli górna zawartość ciągle dodawane, to będzie wyglądać tak
Dolny Linearlayout zostanie wypchnięty z ekranu przed Scrollview stają się aktywne i sprawiają, że stają się najpierw zawartość przewijania .... a ja nie chcę, żeby się stało ...
Co należy zrobić, aby Scrollview przed dno Zobacz pchanych z ekranu jak poniżej:
(jest edytowany obraz a nie stworzony przez Android Edytor)
nadzieję, że pytanie jest wystarczająco jasna .. Dzięki :)
Dlaczego nie trzymać wszystko wewnątrz Scrollview. –
, więc nie chcesz, aby szary tekst poruszał się w ogóle, a czerwone pozostały przewijane, czy to prawda? – Urban