現状のレイアウト(赤枠)と作成したいレイアウト(グレー)が下記のイメージです。
wrap_contentを使っていますが、赤枠のようにはみ出てしまう原因がわかりません。
背景は気にしないでください(適当なスクショを利用したため)
![
アドバイスをいただけると助かります。
xml
1<?xml version="1.0" encoding="utf-8"?> 2<LinearLayout 3 xmlns:android="http://schemas.android.com/apk/res/android" 4 android:layout_width="match_parent" 5 android:layout_height="match_parent" 6 android:orientation="vertical" 7 android:paddingBottom="10dp" 8 android:paddingRight="10dp" 9 android:paddingLeft="10dp"> 10 <LinearLayout 11 android:layout_width="wrap_content" 12 android:layout_height="wrap_content" 13 android:orientation="vertical" 14 android:background="#FFFFFF" > 15 <LinearLayout 16 android:layout_width="wrap_content" 17 android:layout_height="wrap_content" 18 android:orientation="horizontal" 19 android:layout_marginTop="3dp" 20 android:layout_marginLeft="3dp" 21 android:layout_marginRight="3dp" > 22 <LinearLayout 23 android:layout_width="wrap_content" 24 android:layout_height="wrap_content" 25 android:orientation="vertical"> 26 <TextView 27 android:layout_width="wrap_content" 28 android:layout_height="wrap_content" 29 android:text="hogehoge" 30 android:textSize="20sp" 31 android:textColor="#FFA500" 32 android:textStyle="bold" 33 android:layout_margin="3dp" /> 34 <LinearLayout 35 android:layout_width="wrap_content" 36 android:layout_height="wrap_content" 37 android:orientation="horizontal" 38 android:layout_marginLeft="3dp" 39 android:layout_marginRight="3dp" > 40 <ImageView 41 android:layout_width="30dp" 42 android:layout_height="30dp" 43 android:src="@drawable/icon_hogehoge" 44 android:layout_margin="3dp" /> 45 <LinearLayout 46 android:layout_width="wrap_content" 47 android:layout_height="wrap_content" 48 android:orientation="vertical" 49 android:layout_margin="3dp" > 50 <LinearLayout 51 android:layout_width="wrap_content" 52 android:layout_height="wrap_content" 53 android:orientation="horizontal" > 54 <ImageView 55 android:layout_width="12dp" 56 android:layout_height="12dp" 57 android:src="@drawable/icon_hogehoge" /> 58 <TextView 59 android:layout_width="wrap_content" 60 android:layout_height="wrap_content" 61 android:text="hogehoge" 62 android:textSize="12sp" 63 android:textColor="#000000"/> 64 </LinearLayout> 65 <LinearLayout 66 android:layout_width="wrap_content" 67 android:layout_height="wrap_content" 68 android:orientation="horizontal" > 69 <ImageView 70 android:layout_width="12dp" 71 android:layout_height="12dp" 72 android:src="@drawable/icon_hogehoge" /> 73 <TextView 74 android:layout_width="wrap_content" 75 android:layout_height="wrap_content" 76 android:text="hogehoge" 77 android:textSize="12sp" 78 android:textColor="#000000" /> 79 </LinearLayout> 80 </LinearLayout> 81 </LinearLayout> 82 </LinearLayout> 83 <LinearLayout 84 android:layout_width="wrap_content" 85 android:layout_height="wrap_content" 86 android:orientation="vertical"> 87 <ImageView 88 android:layout_width="100dp" 89 android:layout_height="100dp" 90 android:src="@drawable/icon_hogehoge" 91 android:adjustViewBounds="true" /> 92 <LinearLayout 93 android:layout_width="wrap_content" 94 android:layout_height="wrap_content" 95 android:layout_gravity="center" 96 android:orientation="horizontal" 97 android:layout_marginTop="3dp"> 98 <ImageView 99 android:layout_width="15dp" 100 android:layout_height="15dp" 101 android:src="@drawable/icon_hogehoge" /> 102 <TextView 103 android:layout_width="wrap_content" 104 android:layout_height="wrap_content" 105 android:paddingLeft="3dp" 106 android:text="hogehoge" 107 android:textColor="#000000"/> 108 </LinearLayout> 109 </LinearLayout> 110 </LinearLayout> 111 </LinearLayout> 112</LinearLayout> 113
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/03/16 14:23