肯定有关于这个问题的问题,但我发现的相关问题都没有解决我的问题。所以。
我有以下场景,我想要一个可以向下滚动到我将拥有的倍数图表的屏幕。像这张图片代表这里
现在,使用下面的代码,我得到了这个结果。
所以,发生的事情是两个图表都在彼此上,我不知道为什么。
<?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="wrap_content"
android:id="@+id/mainLayout">
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/secondLayout">
<com.github.mikephil.charting.charts.PieChart
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/pieChart" />
<com.github.mikephil.charting.charts.BarChart
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/barChart"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true" />
</RelativeLayout>
</ScrollView>
</RelativeLayout>
我正在使用 MPAndroidchart 库。
谢谢。