<?xml version="1.0" encoding="utf-8"?><br /><ScrollView xmlns:android="http://schemas.android.com/apk/res/android"<br /> android:layout_width="fill_parent"<br /> android:layout_height="wrap_content" ></p><p> <HorizontalScrollView<br /> android:layout_width="fill_parent"<br /> android:layout_height="wrap_content" ></p><p> <RelativeLayout<br /> android:layout_width="fill_parent"<br /> android:layout_height="fill_parent"<br /> android:orientation="horizontal" ></p><p> <TextView<br /> android:id="@+id/textview1"<br /> android:layout_width="wrap_content"<br /> android:layout_height="wrap_content"<br /> android:gravity="center_vertical"<br /> android:text="垂直和水平滾動"<br /> android:textSize="30dp" /></p><p> <ImageView<br /> android:id="@+id/imageview1"<br /> android:layout_width="wrap_content"<br /> android:layout_height="wrap_content"<br /> android:layout_below="@id/textview1"<br /> android:src="@drawable/item1" /></p><p> <ImageView<br /> android:id="@+id/imageview2"<br /> android:layout_width="wrap_content"<br /> android:layout_height="wrap_content"<br /> android:layout_toRightOf="@id/imageview1"<br /> android:layout_below="@id/textview1"<br /> android:src="@drawable/item2" /></p><p> <TextView<br /> android:id="@+id/textview2"<br /> android:layout_width="wrap_content"<br /> android:layout_height="wrap_content"<br /> android:layout_below="@id/imageview1"<br /> android:text="垂直和水平滾動"<br /> android:textSize="30dp" /></p><p> <ImageView<br /> android:id="@+id/imageview2"<br /> android:layout_width="wrap_content"<br /> android:layout_height="wrap_content"<br /> android:layout_below="@id/textview2"<br /> android:src="@drawable/item3" /><br /> </RelativeLayout><br /> </HorizontalScrollView></p><p></ScrollView>
package net.blogjava.mobile;</p><p>import android.app.Activity;<br />import android.os.Bundle;</p><p>public class Main extends Activity {<br /> /** Called when the activity is first created. */<br /> @Override<br /> public void onCreate(Bundle savedInstanceState) {<br /> super.onCreate(savedInstanceState);<br /> setContentView(R.layout.main);<br /> }<br />}