2012-01-30 2 views
3

どのように私はアンドロイドのXMLファイルにスクロールバーを追加できますか? 誰も私を相対レイアウトで追加する簡単な方法を教えてもらえますか? 私はそれを相対レイアウトと直線レイアウトで何度も追加しようとしました。 しかし、動作しません。 解決策を教えてください。アンドロイドのスクロールバー

ありがとうございました。

答えて

3

参考:RELATIVE LAYOUT W.R.T.を使用する方法

SCROLLVIEW

<ScrollView 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@+id/scrollView1" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" > 


    <RelativeLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" >   
    ... ... ... 

</RelativeLayout> 
</ScrollView> 
3

ScrollViewに相対レイアウトまたはリニアレイアウトをラップします。例:上記の答えに

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" > 

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

     <!-- contents of linear layout go here --> 
    </LinearLayout> 
</ScrollView> 
関連する問題