【发布时间】:2016-03-14 16:01:17
【问题描述】:
我在使用 shinobi 图表方面很新。目前我正在尝试设计一个包含图表的布局。布局包含几个其他元素,所以我添加了一个滚动视图来正确管理所有内容......但滚动似乎不起作用......我的布局文件是
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/box_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/box_title_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/box_title_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Titolo" />
<ImageButton
android:id="@+id/box_title_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/dettaglio" />
</LinearLayout>
<ScrollView
android:id="@+id/fragment_detaill_scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true" >
<LinearLayout
android:id="@+id/box_body_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/chart_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<fragment
android:id="@+id/chart_fragment"
android:name="com.shinobicontrols.charts.ChartFragment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:id="@+id/chart_controls"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/lvImageList"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ListView>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
效果在图表之前都是可见的,图表本身是可见的,但是图表下的listview没有。我试图向下滚动,但我无法让它工作。目前我正在使用 Nexus 7 进行开发。有人可以帮助我吗?
编辑:问题在于 ScrollView 不滚动!没有 ListView。如果我删除 ListView 和其他东西 ScrollView 仍然没有滚动!
【问题讨论】:
-
你不能在滚动视图中使用列表视图。
标签: android android-scrollview