4

こんにちは、以下のようなページを作成しようとしています。

ここに画像の説明を入力

ドロワー レイアウトがあり、スクリーン ショットのようにホーム画面に通知を表示したい。私はそれをやろうとしていますCardViewが、でこれを達成する方法を説明するチュートリアルはありませんでしたCardView. のチュートリアルを取得しCardviewましたlistViewが、私の要件ではありません。どうすればこれを達成できるか教えてもらえますか? Androidでこれに使用できるすべてのオプションは何ですか?

4

3 に答える 3

3

Android では RecyclerView と Cardview を検索します。以下の例は、追加した写真のように作成する方法を示すためのものです。n閲覧数の追加はCardView「androidでのRecyclerViewの使い方」。この青い長方形は、Hor.View によってカバーされる領域です。

        <HorizontalScrollView
        android:layout_width="your_size"
        android:layout_height="your_size"
        android:id="@+id/horizontalScrollView"
        android:layout_below="@+id/your_id"
        android:scrollbars="none">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center"
            android:padding="2dp">

            <android.support.v7.widget.CardView
                android:layout_width="250dp"
                android:layout_height="match_parent"
                android:layout_marginStart="2dp"
                android:padding="2dp"
                android:id="@+id/cardThree"
                android:layout_toEndOf="@+id/cardTwo"
                android:background="@color/card_color">

                //your view here like a Layout including textView.

            </android.support.v7.widget.CardView>

            <android.support.v7.widget.CardView
                android:layout_width="250dp"
                android:layout_height="match_parent"
                android:padding="2dp"
                android:id="@+id/cardOne"
                android:background="@color/card_color">

                <//your view here like a Layout including textView.

            </android.support.v7.widget.CardView>

            <android.support.v7.widget.CardView
                android:layout_width="250dp"
                android:layout_height="match_parent"
                android:layout_marginStart="2dp"
                android:padding="2dp"
                android:id="@+id/cardTwo"
                android:layout_toEndOf="@+id/cardOne"
                android:background="@color/card_color">

                //your view here like a Layout including textView.

            </android.support.v7.widget.CardView>
        </RelativeLayout>
    </HorizontalScrollView>
于 2016-09-18T18:03:20.850 に答える