I was wondering, if I merely provide a single layer of LinearLayout
as ListView's row view, its margin will be ignored.
Margin will be ignored if used of ListView's row view
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
However, if I provide double layer of LinearLayout
, with first layer acted as "dummy" layer, its margin will not be ignored.
We will have margin in ListView's row view
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/buyPortfolioLinearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
May I know why it happen so?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…