저는 GraphView 라이브러리로 작업했습니다. 프로그래밍 방식으로 GraphView를 추가해야합니다.스크롤 뷰의 RelativeLayout에 그래프 뷰 추가하기
그래프를 RelativeLayout에 추가 할 때 텍스트 뷰가 페이지를 채우면 그래프가 표시되지 않습니다. 그러나 텍스트 뷰가 비어 있거나 페이지를 완전히 채우지 않으면 그래프가 표시되지만 전부는 아닙니다. 전혀 스크롤하지 않습니다 ....
나는 그래프를 textview 아래에 추가하려고합니다.
이 일이에
GraphViewSeries exampleSeries = new GraphViewSeries(new GraphViewData[] {
new GraphViewData(1, 2.0d)
, new GraphViewData(2, 1.5d)
, new GraphViewData(3, 2.5d)
, new GraphViewData(4, 1.0d)
});
GraphView graphView = new LineGraphView(getActivity(), "GraphViewDemo");
graphView.addSeries(exampleSeries); // data
RelativeLayout layout = (RelativeLayout) v.findViewById(R.id.reletive_layout);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.BELOW, tv2.getId());
layout.addView(graphView,params);
난 주식, 사전에 감사합니다 ... 내 XML
<ScrollView
android:id="@+id/ScrollView02"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
android:scrollbars="none" >
<RelativeLayout
android:id="@+id/reletive_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"/>
</RelativeLayout>
</ScrollView>
코드입니다.
이것은 실제로 작동합니다! 아직 알려지지 않은 이유 : D –