2016-08-24 61 views
0

我正在研究一個可以同時比較三件事的應用程序。通常他們可以一次打開一個並加載到滾動視圖中。我如何在同一屏幕上放置3個滾動視圖,每個視圖佔據屏幕的1/3,以便可以將配置文件加載到每個屏幕中,並且所有3個滾動屏幕都可以滾動。我認爲這會讓一個非常漂亮的比較佈局。Android 3 Scrollviews比較

想法?

所以基本上,整個活動不會滾動,但會包含3個可以分別滾動的小滾動視圖。

Activity image

回答

2

使用android:weightSum
喜歡這個

<LinearLayout 
    android:orientation="vertical" android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:weightSum="3"> 
<ScrollView 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_weight="1" 
     android:text="2" /> 

    <ScrollView 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_weight="1" 
     android:text="2" /> 
    <ScrollView 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_weight="1" 
     android:text="2" /> 


</LinearLayout> 
+0

謝謝!我會upvote,但我需要更多的聲譽.....雖然 – wdavies973

+0

真的很有幫助我會如何使他們堆疊在一起? – wdavies973

+0

可以使用圖片來分享你想要它如何解決你以前的問題請選擇這個答案 – phpdroid