Xml文件  |  51行  |  1.82 KB

<!--
  Copyright 2013 The Android Open Source Project

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <!-- The CardView needs to be wrapped to ensure spacing is applied correctly. -->

    <android.support.v7.widget.CardView
        style="@style/Widget.SampleDashboard.Card"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <LinearLayout
            style="@style/Widget.SampleDashboard.Item"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <TextView
                android:id="@android:id/text1"
                style="@style/Widget.SampleDashboard.Item.Title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Hello world" />

            <TextView
                android:id="@android:id/text2"
                style="@style/Widget.SampleDashboard.Item.Description"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

        </LinearLayout>

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

</FrameLayout>