我試圖在按下按鈕時更改滾動視圖內部的線性佈局的xml佈局/內容。當按下按鈕或使用setVisibility時,我不想調用新的Activity。當按下按鈕時更改XML佈局
到目前爲止,屏幕的10%被預留爲一個導航欄外殼2個按鈕。下面是一個內部呈線性佈局的滾動視圖,其內部將是內容。當按下「下一個」按鈕時,我希望在線性佈局內更改內容。 這是一個參考應用程序,旨在保存50頁以上的信息。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:orientation="horizontal"
android:layout_weight="10">
<Button
android:id="@+id/buttonPrevious"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:text="Previous"
android:layout_weight="30"/>
<Spinner
android:id="@+id/select"
android:layout_width="0dip"
android:layout_height="fill_parent" android:layout_weight="50"/>
<Button
android:id="@+id/buttonNext"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:text="Next" android:layout_weight="20"/>
</LinearLayout>
<ScrollView
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="80">
<LinearLayout
android:id="@+id/linearLayout3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="top|center"
android:text="Header"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="According to the Oxford English Dictionary, hello is an alteration of hallo, hollo,[3] which came from Old High German "halâ, holâ, emphatic imperative of halôn, holôn to fetch, used especially in hailing a ferryman."[4] It also connects the development of hello to the influence of an earlier form, holla, whose origin is in the French holà (roughly, 'whoa there!', from French là 'there').[5] As in addition to hello, hallo and hollo, hullo and (rarely) hillo also exist as variants or related words, the word can be spelt using any of all five vowels.Hello is alternatively thought to come from the word hallo (1840) via hollo (also holla, holloa, halloo, halloa).[9] The definition of hollo is to shout or an exclamation originally shouted in a hunt when the quarry was spotted:[9] Fowler's has it that "hallo" is first recorded "as a shout to call attention" in 1864.[16]" android:textSize="20dip"/>
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:orientation="vertical"
android:layout_weight="10">
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TestAd"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
</LinearLayout>
那麼你希望內容改變到什麼程度?你沒有解釋得很好。 – Squonk 2012-02-12 01:13:46
我打算將其更改爲圖片和相關文本,充當參考應用程序。 – drew 2012-02-12 02:54:46