Ich habe eine App mit einer Seite erstellt, die Inhalte dynamisch aus Web-Service laden müssen. Ich möchte eine Listenansicht haben, die zusammen mit einem linearen Layout innerhalb von NestedScrollView scrollen kann. Wenn der Inhalt jedoch in die Listenansicht geladen wird, wird er nicht auf seine volle Höhe gekratzt.Wie kann ich eine ListView innerhalb einer NestedScrollView haben
Hier ist mein Code.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.myquestionth.myquestionth10.Profile2Activity"
tools:showIn="@layout/activity_profile2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="#BBBBBB" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Media heading"
android:id="@+id/textView2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis."
android:id="@+id/textView8" />
</LinearLayout>
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#70bcf5" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
Ich habe einige gesuchte über scrollview kann nicht verschachtelt werden. Dies ist ein Beispiel, das ich nach meinem Layout von Google Play Review Seite gestalten möchte. Was für eine Methode benutzen sie? Schlage mich vor, wenn ich etwas falsch mache. Danke vielmals.
Hier ist, was ich will.
Fix die Höhe der Listview.Oder der beste Weg ist, Coordinatorlayout und Recyclerview.Refer [This] (http://inthecheesefactory.com/blog/android-design-support-library-codelab/en) –