한 화면에서 스피너가 가장 상단에 존재하고, 그 스피너에 담긴 값에 따라
아래에 있는 탭뷰의 내용이 바뀌는 화면을 구성하고 싶습니다.
xml 코드는 이렇게 할 예정인데.. 자바 파일로 어떻게 저 부분을 구성할지 감이 안옵니다..
도와주세요!
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.cassykim.cassynotice.NoticeActivity">
<Spinner
android:layout_width="match_parent"
android:layout_height="40dp"
android:paddingTop="10dp"
android:id="@+id/notice_spinner">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/frame_layout">
<TabHost
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/tabHost"
android:paddingTop="10dp"
android:orientation = "vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight = "1"
android:orientation="vertical">
<TabWidget
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@android:id/tabs">
</TabWidget>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@android:id/tabcontent"
android:layout_weight = "1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/myClassNotice">
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/listView1">
</ListView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/reference">
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/listView2">
</ListView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/homework">
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/listView3">
</ListView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/questionAndAnswer">
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/listView4">
</ListView>
</LinearLayout>
</FrameLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_alignParentRight = "true"
android:layout_gravity="bottom"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/notice_main_button"
android:text="main"
android:onClick="onClick"
android:layout_marginLeft="10dp"
android:layout_gravity="center"/>
</LinearLayout>
</LinearLayout>
</TabHost>
</FrameLayout>
</Spinner>
</RelativeLayout>