2012-10-05 88 views

回答

2

創建xml file並首先添加HorizontalScrollView然後添加一個佈局作爲孩子。然後你可以添加任何沒有。對新加入的孩子的意見,這使得整個東西scroll

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" > 
    <HorizontalScrollView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" > 
     <RelativeLayout 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" > 
      <!-- child views here --> 
     </RelativeLayout> 
    </HorizontalScrollView> 
</LinearLayout> 
+0

我應該在相對佈局中放入一個列表視圖或顯示英語,法語和所有類似於圖像中顯示的內容?感謝您的回覆 – vaibvorld

+0

@vaibvorld你不應該使用listview和scrollview在一起。它給出不確定的結果。而不是您的要求,添加文字瀏覽或按鈕,以上面所述的水平方向或相對佈局在線性佈局中顯示事物。 – Enthusiast

相關問題