android-scrollview versteckt oben Inhalt
Ich habe ein Problem mit ScrollView. Aus irgendeinem seltsamen Grund, es ist versteckt, dass der Inhalt auf der Oberseite. Ich habe versucht, margin, padding, usw. aber nichts scheint zu funktionieren. Das ist mein layout:
<?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" android:background="@drawable/background">
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:background="@drawable/titlebar"
android:id="@+id/titlebar">
<TextView android:layout_width="fill_parent" android:id="@+id/textView1"
android:layout_height="fill_parent" android:layout_gravity="center"
android:gravity="center" android:textColor="@color/white"
android:textSize="20dip" android:text="Help"></TextView>
</LinearLayout>
<ScrollView android:layout_height="wrap_content" android:id="@+id/scrollView1"
android:layout_width="fill_parent">
<LinearLayout android:orientation="vertical" android:id="@+id/linearLayout2"
android:gravity="center" android:layout_width="fill_parent"
android:layout_gravity="center" android:layout_height="fill_parent"
android:paddingLeft="10dip" android:paddingRight="5dip">
<ImageView android:layout_height="wrap_content"
android:src="@drawable/icon" android:layout_marginTop="10dip"
android:id="@+id/help_icon" android:layout_width="fill_parent"
android:layout_marginBottom="15dip"></ImageView>
<TextView android:layout_height="wrap_content"
android:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed dapibus venenatis suscipit.\n\nCras lacus sem, cursus a dictum sed, condimentum quis urna. Ut vel metus lorem, quis semper lacus. Suspendisse eu urna massa, a blandit mi. "
android:id="@+id/help_text" android:layout_width="wrap_content"
android:textColor="@color/black" android:textSize="15dip"
android:paddingBottom="10dip"></TextView>
</LinearLayout>
</ScrollView>
</LinearLayout>
Mein Bild ist immer, versteckt hinter der oberen Titelleiste, und nur ein kleiner Teil der Unterseite ist sichtbar in das Gerät/emulator. Es scheint fein in Eclipse. Ich bin mit ADT11
Vielen Dank im Voraus!
- seine Ordnung, die in meinem Fall.
- Welche version von ADT verwenden Sie? Ich hatte nie irgendwelche Probleme mit scrollviews, bis ich begann mit ADT11
- Können Sie bitte das snap, wenn möglich.
- Ich bin mit ADT 10.
- imageshack.us/photo/my-images/696/scrollbarp.png
- die Standard-android-Bild dort oben ist die textview, die aber nicht sichtbar
- Mögliche Duplikate von Android-scrollview versteckt top-Inhalte im layout
Du musst angemeldet sein, um einen Kommentar abzugeben.
Ich denke, Sie wollen so etwas wie dieses:
Hallo ich hatte das gleiche problem und nach recherche habe ich die Lösung gefunden, und in Ihren XML-code kann ich sehen, dass Sie machen die gleichen Fehler im layout.
Das problem ist, dass Sie die Einstellung der ScrollView Kind (LinearLayout) layout_gravity center. Entfernen Sie diese Zeile und es sollte für Sie arbeiten.
Hinzufügen android:layout_weight="1", um Ihre scrollview. Es wird das problem zu beheben. So etwas