Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
親で、子のマージンを定義できるかどうか疑問に思っています。
このような:
<LinearLayout childrenMargin="10dp" > <child /> <child /> <child /> </LinearLayout>
またはlayout_margin、子供用に設定する必要がありますか?
layout_margin
親要素にパディングを追加したいようです。
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="10dp" > ... </LinearLayout>
考え方の 1 つは、パディングはビューの内側の間隔(つまり、ビューとその子の間のスペース) であり、マージンはビューの外側のスペース(それとその親および隣接するビューの間のスペース) であるということです。