【发布时间】:2018-01-17 18:52:33
【问题描述】:
我有三张牌。我想一次显示两张卡片,当用户向下滚动时,用户可以看到第三张卡片。但现在它通过降低每张卡片的高度一次显示三张卡片。我想要三张相同高度的卡片。
这是我的布局 xml 文件:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.coderz.creative.music.Fragment.HomeFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/chart_layout"
android:orientation="vertical"
>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
>
<com.github.mikephil.charting.charts.PieChart
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/pie_chart_spend"
>
</com.github.mikephil.charting.charts.PieChart>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
>
<com.github.mikephil.charting.charts.BarChart
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/bar_chart_spend"
>
</com.github.mikephil.charting.charts.BarChart>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
>
<com.github.mikephil.charting.charts.BarChart
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/pie_chart_spend_on_click"
>
</com.github.mikephil.charting.charts.BarChart>
</android.support.v7.widget.CardView>
</LinearLayout>
</FrameLayout>
【问题讨论】:
-
您想显示两张卡片(填满整个屏幕)和它们下方的第三张卡片,它们都具有相同的高度?
-
是的 elmorabea。我想要这个。
标签: android scrollview android-linearlayout