androidアプリ作成において、eclipseのxmlでウィジェットの大きさを比率で配置しようとlayout_weightをしてますが上手く行きません。
それはscrollViewの部分です。
weightを7で大きく設定してますが、添付画像の青い枠内のように余白が結構入ってしまいます。
本当は、青い枠一杯まで広げたいです。
どうすれば良いでしょうか?
xml
1<?xml version="1.0" encoding="utf-8"?> 2<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:layout_width="match_parent" 4 android:layout_height="match_parent" 5 android:orientation="vertical" > 6 7 <LinearLayout 8 android:layout_width="match_parent" 9 android:layout_height="match_parent" 10 android:orientation="vertical" 11 android:weightSum="10" > 12 13 <TextView 14 android:id="@+id/title" 15 android:layout_width="match_parent" 16 android:layout_height="0dp" 17 android:layout_gravity="center_horizontal" 18 android:layout_marginTop="10dp" 19 android:layout_weight="1" 20 android:background="@drawable/msg_box" 21 android:text="リザルト" /> 22 23 <ScrollView 24 android:layout_width="match_parent" 25 android:layout_height="0dp" 26 android:layout_marginTop="10dp" 27 android:layout_weight="7" > 28 29 <TextView 30 android:id="@+id/info" 31 android:layout_width="match_parent" 32 android:layout_height="match_parent" 33 android:background="@drawable/msg_box" 34 android:text="info" /> 35 </ScrollView> 36 37 <LinearLayout 38 android:layout_width="match_parent" 39 android:layout_height="0dp" 40 android:layout_marginTop="10dp" 41 android:layout_weight="1" 42 android:orientation="horizontal" > 43 44 <ImageView 45 android:id="@+id/player1" 46 android:layout_width="wrap_content" 47 android:layout_height="match_parent" 48 android:layout_gravity="left" /> 49 50 <ImageView 51 android:id="@+id/player2" 52 android:layout_width="wrap_content" 53 android:layout_height="match_parent" 54 android:layout_gravity="fill_vertical" /> 55 56 <ImageView 57 android:id="@+id/player3" 58 android:layout_width="wrap_content" 59 android:layout_height="match_parent" 60 android:layout_gravity="fill_vertical" /> 61 62 <ImageView 63 android:id="@+id/player4" 64 android:layout_width="wrap_content" 65 android:layout_height="match_parent" 66 android:layout_gravity="right" /> 67 </LinearLayout> 68 69 <Button 70 android:id="@+id/backbutton" 71 android:layout_width="match_parent" 72 android:layout_height="0dp" 73 android:layout_gravity="center_horizontal" 74 android:layout_marginTop="10dp" 75 android:layout_weight="1" 76 android:text="戻る" /> 77 </LinearLayout> 78 79</FrameLayout>
回答2件
あなたの回答
tips
プレビュー