请问Android中怎么在一个线性布局里面添加多个图表控件

图表控件我用的是AchartEngine
设置好数据和样式之后
用ChartFactory.getXXXXXChartView方法,获得图表的View
然后通过linearLayout.addView(getPieView());
填充到vertical的线性布局里面

填充一个图表的View时,显示是正常的
但填充2个或以上的时候,就只会显示第一个
后面我在线性布局外层又添加了一个垂直的ScrollView
也不行,也只是显示第一个而已


xml布局如下

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/back"
    android:orientation="vertical" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="10dp"
        android:layout_marginTop="10dp"
        android:orientation="horizontal" >

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:gravity="center"
            android:orientation="vertical" >

            <TextView
                android:id="@+id/textView2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="请选择时间段:"
                android:textColor="@color/gray_dark"
                android:textSize="@dimen/normal" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:gravity="center"
            android:orientation="horizontal" >

            <TextView
                android:id="@+id/tv_tongji_yingyeXY_timestart"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="2015-06-07"
                android:textColor="@color/gray_dark"
                android:textSize="@dimen/normal" />

            <TextView
                android:id="@+id/textView3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:layout_marginRight="5dp"
                android:text="至"
                android:textColor="@color/gray_dark"
                android:textSize="@dimen/normal"
                android:visibility="visible" />

            <TextView
                android:id="@+id/tv_tongji_yingyeXY_timeend"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="2015-07-10"
                android:textColor="@color/gray_dark"
                android:textSize="@dimen/normal" />
        </LinearLayout>
    </LinearLayout>

    <ScrollView
        android:id="@+id/scrollView1"
        android:layout_width="match_parent"
        android:layout_height="fill_parent"
        android:fillViewport="true" >

        <LinearLayout
            android:id="@+id/layout_yingyeXYView"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="@color/back"
            android:orientation="vertical" >
        </LinearLayout>
    </ScrollView>

</LinearLayout>


请问有什么解决方法吗,让这个布局里面能显示多个图表的控件
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值