當我進入橫向模式時,我的活動底部的兩個按鈕不可見。屏幕應該已自動轉換爲可滾動。是否必須向我的xml或清單文件添加內容?查看設備方向變化時的問題
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Text in Hindi->"
/>
<TextView
style="@style/PassageStyle"
android:id="@+id/hindi"
android:textSize="30sp"
android:gravity="center"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Corresponding Text in English->"
/>
<TextView
style="@style/PassageStyle"
android:id="@+id/english"
android:textSize="30dip"
android:gravity="center"
/>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:id="@+id/listen_Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="60dip"
android:text="@string/listen"
/>
<Button
android:id="@+id/slow_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Slow"
android:layout_marginLeft="30dip"
android:layout_toRightOf="@id/listen_Button"
android:layout_alignTop="@id/listen_Button"
/>
<Button
android:id="@+id/voice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/voice"
android:layout_alignLeft="@id/listen_Button"
android:layout_below="@id/listen_Button"
/>
<Button
android:id="@+id/next_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Next"
android:layout_below="@id/slow_button"
android:layout_alignLeft="@id/slow_button"
/>
</RelativeLayout>
</LinearLayout>
什麼讓你有那個想法? – Maximus 2011-05-30 19:26:11
我有另一個Listactivity爲它工作fine.Any解決上述問題? – vagrawal13 2011-05-30 19:28:57
ListView的內容本質上是可滾動的,所以一切都會好的。在LinearLayout中一個接一個地放置的單個視圖不是。 – Maximus 2011-05-30 19:32:06