Code example for LinearLayout.LayoutParams

Methods: setMargins

0
 
public class InfoController { 
	public static LinearLayout makeInfo(Context context, InfoVo infoVo) {
		LinearLayout layout_info = new LinearLayout(context);
		layout_info.setOrientation(LinearLayout.HORIZONTAL);
		LayoutParams layoutParams_layout_info = new LinearLayout.LayoutParams(
				LayoutParams.MATCH_PARENT, Actions.DPFromPixel(100));
		layoutParams_layout_info.setMargins(0, Actions.DPFromPixel(5), 0,
				Actions.DPFromPixel(5)); 
		layout_info.setLayoutParams(layoutParams_layout_info);
 
		layout_info.setPadding(Actions.DPFromPixel(20),
				Actions.DPFromPixel(10), Actions.DPFromPixel(20), 
				Actions.DPFromPixel(10)); 
		layout_info.setBackgroundColor(Color.parseColor("#AAAAAA"));
 
		{// 인포 - busNum 텍스트뷰 설정 부분 
			TextView textview_busNum = new TextView(context);
			textview_busNum.setText(infoVo.getBusNum());
			textview_busNum.setTextColor(Color.parseColor("#222222"));
			textview_busNum.setTextSize((float) Actions.DPFromPixel(12));