2013-11-23 44 views
0

我試圖做一個線性佈局滾動使用滾動視圖,使投入imageViews不推了屏幕的其他意見和功能類似這樣的圖片:製作的LinearLayout滾動

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" > 

<LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"> 

<TextView 
    android:id="@+id/personalizetextView1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="@string/customize" 
    android:textSize="30sp" 
    android:gravity="center" 
    android:layout_marginTop="20dip"/> 

<TextView 
    android:id="@+id/personalizetextviewChangeBackground" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="@string/customizebackground" 
    android:gravity="center" /> 

<ImageView 
    android:id="@+id/imageView1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:adjustViewBounds="true" 
    android:maxWidth="100dp" 
    android:maxHeight="100dp" 
    android:scaleType="fitCenter" 
    android:contentDescription="@string/descForBackground" 

    /> 

<Button 
    android:id="@+id/btnChangeImage" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="@string/change_background" /> 

<Button 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="@string/set_background" 
    android:id="@+id/btnSetBackground" /> 

<TextView 
    android:id="@+id/personalizetextviewChangeIcon" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="@string/change_icon" 
    android:gravity="center" /> 

<ImageView 
    android:id="@+id/imageView2Icon" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:adjustViewBounds="true" 
    android:maxWidth="100dp" 
    android:maxHeight="100dp" 
    android:scaleType="fitCenter" 
    android:contentDescription="@string/descForIcon" 
    /> 

<Button 
    android:id="@+id/btnChangeImageForIcon" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="@string/change_icon" /> 

<Button 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="@string/set_icon" 
    android:id="@+id/btnSetIcon" /> 

    <Button 
     android:id="@+id/btnLinkToFeedback" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginTop="40dip" 
     android:background="@null" 
     android:text="@string/Send_Feedback" 
     android:textColor="#21dbd4" 
     android:textStyle="bold" /> 

     </LinearLayout> 
</ScrollView> 

但它只是讓我的第一個textView顯示出來,沒有別的。 我能做些什麼來解決這個問題?

+0

http://stackoverflow.com/questions/3416689/how-to-make-a-linearlayout-scrollable?rq=1 – alvin

回答

2

android:orientation="vertical" 

LinearLayout而不是在ScrollView

默認方向爲LinearLayouthorizontal和你TextView可能跨越多行的。

相關問題