我设置了android:layout_marginLeft
属性,我不明白它是否会保留父母或旁边的下一个视图的距离/边距?
Doc只说:Specifies extra space on the left side of this view. This space is outside this view's bounds. Margin values should be positive.
。
答案 0 :(得分:1)
取决于父级布局。
如果它是LinearLayout
,RelativeLayout
,TableRow
,那么android:layout_marginLeft
属性将在同一父视图的上一个孩子的左侧指定额外空间层次结构(周围的视图)。
如果它是FrameLayout
,则android:layout_marginLeft
属性将在其父级的左侧指定额外空间。它不会受到同一父母的其他孩子的影响。
答案 1 :(得分:0)
它将在父LayoutGroup
中设置该视图的边距