2010-12-17 11 views
0

横向きのときにAndroidビューのスクロールをしようとしています。しかし、これは私が試したどのデバイスでも動作しません。私が間違っていることに関するアイデアは?ここに私のマークアップがあります:Android scrollviewはランドスケープモードの相対レイアウトではありません

<ScrollView 
    android:layout_height="fill_parent" 
    android:layout_width="fill_parent"> 
     <RelativeLayout 
     android:id="@+id/sample1" 
     android:gravity="top" 
     android:layout_height="fill_parent" 
     android:layout_width="fill_parent"> 
     <ImageView 
     android:src="@drawable/sample1" 
     android:layout_centerHorizontal="true" 
     android:layout_width="fill_parent" 
     android:padding="10dp" 
     android:layout_height="wrap_content" 
     android:layout_marginTop="20dp"/> 
     </RelativeLayout> 
    </ScrollView> 
<LinearLayout android:id="buttons" 
xmlns:android="schemas.android.com/apk/res/android"; 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:orientation="horizontal" 
android:layout_alignParentBottom="true" android:padding="3dp"> 
... 
</LinearLayout> 

更新:このビューには、追加の線形レイアウトが含まれています。私はこれが問題かもしれないと信じています。何か案は?

+0

あなたのxmlで何も間違っていないフライを見て、あなたはそれが任意のデバイスでは動作しないと言うん理由はありません、多分あなたはLogCatスローどのようなエラーを投稿することができます... – Franco

+0

をすることができますあなたの 'res/layout-land/YOUR_FILE_NAME'に' layout-land'ファイルがあり、それぞれの(縦/横)モードのレイアウトが違っているかどうか確認してください。 – Samuel

答えて

0

このコードに問題はありません。私は768x1024 jpgで試してみました。これはmdpiのドロウアブルフォルダに置かれています。あなたが使ったイメージの解像度は?レイアウトにTextViewや他のビューが組み込まれていませんか?

alt text

+0

私の間違いです。インクルードでページの下部に引っ張られる一連のボタンを保持する線形レイアウトがあります。 <のLinearLayout \tアンドロイド:ID = "ボタン" \tのxmlns:アンドロイド= "http://schemas.android.com/apk/res/android" \tアンドロイド:layout_width = "fill_parent" \tアンドロイド:layout_height =」 wrap_content " \t android:orientation =" horizo​​ntal " \t android:layout_alignParentBottom =" true " \t android:padding =" 3dp "> – mdunkle

関連する問題