/ / Grid-Ansicht wie Windows 8 oder Google Play - Android, Android-Layout, Gridview, Windows-8, Google-Play

Grid-Ansicht wie Windows 8 oder Google Play - Android, Android-Layout, Gridview, Windows-8, Google-Play

Ich suche nach dem Quellcode oder einem Beispiel einer Gridview. Ich weiß, dass ich mit Eclipse etwas wirklich Einfaches machen kann: viele Quadrate nebeneinander.

Aber ich möchte etwas Seltsames und Spezielles haben, wie dieses Beispiel:

Klicken Hier

Jemand kann mir helfen?

Antworten:

0 für die Antwort № 1

Sie können StaggerdGridview von hier verwenden Github

Es sieht aus wie das

Bildbeschreibung hier eingeben


0 für die Antwort № 2

Sie können dies durch Layout-Verschachtelung tun. Es ist im Grunde wie Ihre HTML-Seiten. Zum Beispiel:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="226dp"
android:background="@color/dark_shadow">
</LinearLayout>

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<LinearLayout
android:orientation="vertical"
android:layout_width="180dp"
android:layout_height="fill_parent"
android:background="@color/holo_bright_blue">
</LinearLayout>

<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>

<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="154dp"
android:background="@color/me_blue">
</LinearLayout>

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<LinearLayout
android:orientation="vertical"
android:layout_width="106dp"
android:layout_height="fill_parent"
android:background="@color/dark_shadow">
</LinearLayout>

<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/light_gray">
</LinearLayout>
</LinearLayout>
</LinearLayout>

</LinearLayout>
</LinearLayout>

Verwenden Sie auch das Layout-Gewicht und die Gewichtssumme des übergeordneten Containers, wenn Sie innerhalb dieser Layouts weitere Ansichten hinzufügen müssen. Ich hoffe, dies wird Ihnen einige Hinweise geben, was Sie erreichen möchten.