###前提・実現したいこと
androidでLayoutを作成しています。
com.android.support:appcompat-v7:23.4.0を利用しています。
LinearLayout上に単純にButtonを2つ配置しています。
それぞれのButtonにlayout_margin_bottomを指定しているのですが、指定した値より約8dp大きくmarginがとられてしまいます。
backgroundを指定すると正常に動作します。(正しくmarginがとられます)
backgroundの指定をせず意図したmarginをとるにはどうしたらよいでしょうか
###発生している問題・エラーメッセージ
なし
###該当のソースコード
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.mackagy.sample.MainActivity" android:orientation="vertical"> <Button android:id="@+id/test1" android:layout_width="100dp" android:layout_height="30dp" android:textSize="10sp" android:textColor="@android:color/white" android:layout_gravity="center_horizontal" android:gravity="center" android:text="aaaaaaaaaaaaaaaaaaaaaaaa" android:layout_marginBottom="8dp" /> <!-- ここのmarginが正しくとれない --> <Button android:id="@+id/test2" android:layout_width="100dp" android:layout_height="30dp" android:textSize="10sp" android:textColor="@android:color/white" android:layout_gravity="center_horizontal" android:gravity="center" android:text="aaaaaaaaaaaaaaaaaaaaaaaa" /> </LinearLayout>
###試したこと
課題に対してアプローチしたことを記載してください
###補足情報(言語/FW/ツール等のバージョンなど)
より詳細な情報
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/06/09 12:29