【发布时间】:2016-12-12 18:17:28
【问题描述】:
我似乎无法将按钮和 androidplot 一起放入滚动视图中,这样我就可以向下滚动,越过 androidplot 来查看按钮。我正在使用 androidplot 0.9.8。
这是我的 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 指定某个高度(例如 android:layout_height="600dp" 而不是 android:layout_height="match_parent")时,它似乎可以正常滚动。为什么使用 match_parent 会阻止它滚动?
【问题讨论】:
-
你的RelativeView没有正确关闭
-
抱歉,错字。仍然遇到同样的问题
标签: android button scrollview androidplot