我似乎無法將按鈕和androidplot一起放入滾動視圖中,以便我可以向下滾動,通過androidplot查看按鈕。我正在使用androidplot 0.9.8。將按鈕和androidplot添加到滾動視圖
這裏是我的xml文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ap="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="example.example.MainActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/plotLayout">
<com.androidplot.xy.XYPlot
android:id="@+id/plot"
android:layout_width="match_parent"
android:layout_height="match_parent"
ap:Label="test"
ap:domainLabel="test"
ap:rangeLabel="test"
ap:renderMode="use_main_thread"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@id/plot">
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="test"/>
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="test"/>
</LinearLayout>
</RelativeLayout>
</ScrollView>
編輯:看來然而,當我指定了一定的高度爲androidplot(如機器人:layout_height =的 「600dp的」,而不是機器人:layout_height = 「match_parent」)它滾動罰款。爲什麼使用match_parent阻止它滾動?
你RelativeView沒有正確關閉 –
對不起,錯字。仍然得到相同的問題 –