0
今天我想要做的事情非常詭異。我想根據包含2個TableRows的TableLayout進行佈局。在這些表格裏面會有ScrollViews。3桌面佈局中的滾動視圖
我做了佈局,但沒有scrollviews的... ...滾動我可以告訴你的佈局XML:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<TableRow android:id="@+id/tableRow1" android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ScrollView android:id="@+id/scrollView3"
android:layout_width="fill_parent" android:layout_height="50px"
android:layout_column="1" android:fillViewport="true">
<LinearLayout android:id="@+id/linearLayout3"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:background="#FF000000">
<TextView android:id="@+id/testText2" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Ca cest le trois. Lorem Ipsum dolor sit amet sin dolor con mi amor est la melhor que nullum ad quam ergo cum aret. Diligenti am Lubillam am Lubillum."></TextView>
<TextView android:id="@+id/testText3" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Ca cest le trois. Lorem Ipsum dolor sit amet sin dolor con mi amor est la melhor que nullum ad quam ergo cum aret. Diligenti am Lubillam am Lubillum."></TextView>
</LinearLayout>
</ScrollView>
</TableRow>
<TableRow android:id="@+id/tableRow2" android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ScrollView android:id="@+id/scrollView1"
android:layout_width="100px" android:background="#00FF0000"
android:layout_height="fill_parent" android:fillViewport="true">
<LinearLayout android:layout_width="wrap_content"
android:id="@+id/linearLayout1" android:layout_height="fill_parent">
<TextView android:id="@+id/LeftTextView"
android:layout_width="wrap_content" android:layout_height="fill_parent"
android:gravity="center_horizontal|center_vertical"
android:background="#00FF0000" android:text="Ouais !"></TextView>
</LinearLayout>
</ScrollView>
<ScrollView android:id="@+id/scrollView2"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:scrollX="20px" android:scrollY="20px" android:fillViewport="true">
<LinearLayout android:id="@+id/llTest2"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView android:src="@drawable/android" android:id="@+id/AndroDraw"
android:layout_width="wrap_content" android:layout_height="wrap_content"></ImageView>
<TextView android:id="@+id/testTesttest2" android:text="Test test test!!"
android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
</LinearLayout>
</ScrollView>
</TableRow>
</TableLayout>
任何想法? 謝謝;)!
很奇怪。我測試了你的代碼,並且整個tableLayout沒有填充屏幕,(就像它包裝了按鈕的文本),然後我看不到我的佈局代碼有什麼區別!不過,非常感謝你的回答! – Codii 2011-04-18 13:26:03