내 XML이 2 LinearLayouts
입니다.LinearLayout에 다른 뷰를 팽창시키는 방법?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/ll_one"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
<LinearLayout
android:id="@+id/ll_two"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
</LinearLayout>
http://android.arnodenhond.com/components/graphview에서 GraphView를 다운로드했습니다. 이 클래스는 View를 확장합니다. 나는 기본적으로
String[] verlabels = new String[]{"aim", "25%", "50%", "75%", "start"};
String[] horlabels = new String[]{"this", "max"};
float[] values = new float[]{2.0f, 6.0f};
aaaGraphView graphView = new aaaGraphView(this, values, "Graph One",
horlabels, verlabels, aaaGraphView.BAR);
float[] values2 = new float[]{1.0f, 12.0f};
aaaGraphView graphView2 = new aaaGraphView(this, values2, "Graph Two",
horlabels, verlabels, aaaGraphView.BAR);
를 통해 2 그래프를 초기화 한 후 ll_two
로 ll_one
에 graphView
및 graphView2
을 팽창하고 싶습니다.
어떻게해야합니까? 나는 LinearLayout
llOne = (LinearLayout) findViewById(R.id.ll_one);
초기화했지만 그것은 inflate()
방법이 없습니다.
답변으로 표시하십시오. – breceivemail
감사하지만 프로그래밍 방식으로이 작업을 수행 할 방법을 찾고있었습니다. – sandalone