【发布时间】:2016-06-17 23:22:28
【问题描述】:
我在滚动视图和卡片视图中添加了卡片视图我添加了偏好片段,但它只显示偏好类别标题。
setting.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.afollestad.appthemeengine.inflation.ATEToolbar
android:id="@+id/toolbar"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/view"
android:layout_below="@+id/toolbar">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardElevation="4dp"
style="?attr/CardTheme" />
</RelativeLayout>
</ScrollView>
</RelativeLayout>
任何解决方案。
【问题讨论】:
-
请发布您的片段 xml。
-
您的卡片视图的高度为“wrap_content”。所以它包装了卡片。在卡片内添加项目。
标签: android scrollview android-cardview