산업공학과 마지막 학기 학생으로 프로그래밍엔 완전.. 초보입니다. 졸업논문 때문에 간단한 어플을 만들고 있습니다.
논문의 중반부까지는 해결이 되었는데 마지막으로 구혀해야하는 안드로이드 어플이 애를 먹여..
졸업을 할 수 없는 상황에 처했습니다 ㅜ.ㅜ
개발자님들 답변 부탁드립니다...
아래 그림과 같이 어플을 만들고자 합니다..
여기서 질문은
아래 리스트 중에서 하나를 클릭했을 때 그래프가 자동으로 그려지게 하고 싶습니다.
그래프는 어떻게.. 그릴 수 있나요? 그래프 라이브러리를 하나 받긴했는데.. 어케하는지 모르겠어서요 ㅜ.ㅜ
탭별로 xml파일과 java 파일을 따로 만들어야하나요..?
인텐트부분과.. 그래프 그리는 부분.. 잘 습니다 ㅜ.ㅜ.ㅜㅜ
=================
package my.HelloTabWidget;
import android.app.TabActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.TabHost;
import android.widget.ListView;
public class HelloTabWidget2 extends TabActivity {
TabHost mTabHost = null;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
String[] aStrings = {"해장국","된장찌게"};//메뉴는 받아와야겠죠
ListView list = (ListView) findViewById(R.id.listview1);
list.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, aStrings));
String[] bStrings = {"돈가스","오징어덮밥","떡볶이"};
ListView list2 = (ListView) findViewById(R.id.listview2);
list2.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, bStrings));
String[] cStrings = {"철판볶음밥","부대찌게"};
ListView list3 = (ListView) findViewById(R.id.listview3);
list3.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, cStrings));
mTabHost = getTabHost();
mTabHost.addTab(mTabHost.newTabSpec("tab_test1").setIndicator("아침메뉴").setContent(R.id.listview1));
mTabHost.addTab(mTabHost.newTabSpec("tab_test2").setIndicator("점심메뉴").setContent(R.id.listview2));
mTabHost.addTab(mTabHost.newTabSpec("tab_test3").setIndicator("저녁메뉴").setContent(R.id.listview3));
mTabHost.setCurrentTab(0);
}
}
==========================
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView
android:id="@+id/listview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<ListView
android:id="@+id/listview2"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<ListView
android:id="@+id/listview3"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</FrameLayout>
</LinearLayout>
</TabHost>
=================================
지금은 이케두개의 파일만 있는데.. 탭별로 따로 만들.. 필요가 잇나요?




정 다른 방법이 없고, 이쁘지 않아도 된다면
Imageview 하나 붙이시고 여기에 라인으로 그려버리세요.
그리고 라인으로 그려도 색을 예쁘게 채우시면 어느정도 볼만 하게 나오더군요.
일단 화면의 크기를 받아오셔서 끝과 끝에 좌표를 기준으로 적당하게 그려주면 될거라 보입니다.