ViewGroup.MarginLayoutParams.layout_marginLeft

左側の間隔はlayout_marginLeftで調整する・・・。

ViewGroup.MarginLayoutParams | Android Developers

前回は、親のViewGroupとの境界線の間隔しか設定しなかったが、今回は6つのTextViewを用意し、同階層のViewとView同士の間隔も設定する・・・。

strings.xmlに、

として、

horizontalなLinearLayoutを中に入れて、背景は青・・・。
その中にTextViewを3つで、それぞれの背景は赤にし、layout_marginTop、layout_marginLeftともに10dpに・・・。
textview1aは縦横どちらもLinearLayoutの境界線との間隔・・・。
textview1b、textview1cは縦がLinearLayoutの境界線との間隔なのに対し、横は隣のTextViewとの間隔・・・。

同様に、horizontalなLinearLayoutにTextView3つ・・・。
LinearLayoutの背景は緑、TextViewの背景は黄色・・・。
TextViewのlayout_marginTop、layout_marginLeftともに10dpに・・・。

実行すると、

f:id:BG1:20170102162359p:plain

このように、TextViewの上側と左側の間隔が10dp空く・・・。

Sample/android/ViewGroup.MarginLayoutParams/layout_marginLeft/src/ViewGroup.MarginLayoutParams at master · bg1bgst333/Sample · GitHub