Ich habe eine Aktivität, die den Inhalt einer E-Mail anzeigt. Es gibt eine Kopfzeile mit Empfängern und Datum und eine Webansicht zum Anzeigen von E-Mail-Inhalt.Android Webview: Wie scrollt man das gesamte Aktivitätslayout
Wenn die Mail sehr lang ist, kein Problem, es gibt Bildlaufleisten in der Webansicht.
Aber mein Problem ist, wenn die Empfängerliste sehr lang ist, nimmt die Kopfzeile 50% der Bildschirmhöhe, und die Webansicht nimmt nur 50% der Bildschirmhöhe, und ich kann nur innerhalb dieser 50% scrollen. Ich würde gerne das gesamte Aktivitätslayout durchblättern (ich möchte, dass die Webansicht ihre volle Höhe erhält und diese Bildlaufleiste auf der gesamten Aktivität erscheint). Hier
ist ein Bild, mein Problem darstellt:
Hier mein layout.xml ist:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:orientation="vertical"
android:scrollbars="horizontal" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@layout/header_gradient" >
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#DEDEDE"
android:orientation="vertical"
android:padding="2dp" >
<TextView
android:id="@+id/label_mail_object"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="<mail_object>"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/label_mail_from"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="<from>"
android:textColor="#0000FF" />
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:shrinkColumns="0"
android:stretchColumns="1" >
<!-- Send time -->
<TableRow
android:id="@+id/tablerow_sent_date"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_sent_date"
android:textStyle="bold" />
<TextView
android:id="@+id/label_mail_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="<sent_date>" />
</TableRow>
<!-- To -->
<TableRow
android:id="@+id/tablerow_to"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_to"
android:textStyle="bold" />
<TextView
android:id="@+id/label_mail_to"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxWidth="@dimen/padding_large"
android:text="<to>" />
</TableRow>
<!-- Cc -->
<TableRow
android:id="@+id/tablerow_cc"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_cc"
android:textStyle="bold" />
<TextView
android:id="@+id/label_mail_cc"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxWidth="@dimen/padding_large"
android:text="<cc>" />
</TableRow>
<!-- To -->
<TableRow
android:id="@+id/tablerow_cci"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_cci"
android:textStyle="bold" />
<TextView
android:id="@+id/label_mail_cci"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxWidth="@dimen/padding_large"
android:text="<cci>" />
</TableRow>
</TableLayout>
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#808080" />
<WebView
android:id="@+id/webview_mail_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
Großartig !!! Ich habe das ganze Layout mit einem ScrollView umrahmt, und es scrollt wie ich wollte !!! – MarneusCalgarXP
Ich habe vergessen zu sagen: Vielen Dank;) – MarneusCalgarXP