我想在活动中得到一个图表和3个按钮。 3个按钮应该在图表下方对齐。我有以下XML但按键都只是通过图表抑制(编辑清晰:该按钮不可见)相对布局的孩子采取屏幕的全高
<RelativeLayout 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"
android:orientation="vertical"
tools:context=".PlotActivity">
<com.github.mikephil.charting.charts.LineChart
android:id="@+id/chart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"/>
<Button
android:id="@+id/one_week_preset_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/chart"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:text="@string/one_week_label" />
<Button
android:id="@+id/one_month_preset_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/chart"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="@string/one_month_label" />
<Button
android:id="@+id/download_new_data_and_update_graph"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/chart"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:text="@string/download_and_update_label" />
</RelativeLayout>
我敢肯定,这可以很容易地通过线性布局的二级嵌套来完成,但是这个XML有什么问题以及如何解决这个问题。任何帮助赞赏。
上述XML产生下面的屏幕所示机器人工作室(请注意,图占据整个屏幕,并因此按钮不可见)
什么用线型图的,你也尝试使用它的另一种观点就地,请与像EDITTEXT或查看其他视图检查,保证,有什么是我们必须解决这个问题,谢谢 – Androider
@Androider折线图用于显示图表(图表)。它来自'mpandroidchart'库,用于绘制图表。问题在于,按照您在图像中看到的方式,按钮并未显示在布局中。 –