Ich habe Schwierigkeiten, die Ansichten meiner Aktivitäten zu ordnen.
Ich mag einen einfachen Effekt erreichen:Anordnung von Ansichten mit einem scrollbaren Layout und einem Filterpanel
- Filterbehälter mit einigen Textansichten und Radios, die Aktionen zu zeigen, wäre in der Lage/verstecken
- unten: Rasteransicht mit großer Menge an Fotos
Natürlich möchte ich meine Ansicht scrollbar machen, damit der Benutzer nach unten scrollen kann, um alle Fotos anzuzeigen.
Außerdem möchte ich die Filterposition fixieren - ganz oben platziert.
Dies ist das gewünschte Layout.
Ich habe versucht, es in folgenden Weise zu tun:
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="..."
android:id="@+id/allViews">
<!-- panel with some filter controls -->
<LinearLayout
android:id="@+id/searchOpts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/search_opts_margin"
android:visibility="gone"
android:orientation="vertical">
<RadioGroup
android:id="@+id/sortOrder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:orientation="horizontal">
<RadioButton
android:id="@+id/orderByTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<RadioButton
android:id="@+id/orderByRating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RadioGroup>
<MultiAutoCompleteTextView
android:id="@+id/tags"
android:hint="@string/tags_label"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:inputType="textNoSuggestions|textCapSentences|textMultiLine"
android:textSize="16sp"
android:textColor="#555"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/sortOrder" />
</LinearLayout>
<!-- panel with grid of big amount of images -->
<ScrollView 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_marginBottom="5dp"
android:id="@+id/sv"
android:layout_width="match_parent"
android:layout_marginTop="@dimen/items_grid_margin_under_search_opts"
app:layout_constraintTop_toBottomOf="@+id/searchOpts"
android:layout_height="match_parent" >
<GridView
android:id="@+id/PhotosGrid"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:columnWidth="100dp"
android:drawSelectorOnTop="true"
android:gravity="center"
android:numColumns="auto_fit"
android:verticalSpacing="5dp"
android:horizontalSpacing="5dp"
android:focusable="true"
android:clickable="true"/>
</ScrollView>
</android.support.constraint.ConstraintLayout>
Leider scheiterte ich und etwas Hilfe benötigen.
Was erreicht wurde und welche Hilfe gesucht? – Akhil
Sie benötigen keine ScrollView für das Raster, es ist bereits scrollbar für sich selbst, wenn es mehr Elemente gibt, die es in dem Raum zeigen kann, wird es automatisch scrollen – elmorabea
Erstens, Scroll-Ansicht überlappt Filter-Panel trotz ich verwendet : app: layout_constraintTop_toBottomOf = "@ + id/searchOpts" – pumbosha