Code example for LinearLayout

Methods: setOrientationaddView

0
	protected Context m;
	protected abstract void onInit(boolean inXML);
	private void init(Context context, AttributeSet attrs, int defStyle){
		m = context;
		if (getChildCount() == 0){
			LinearLayout l = new LinearLayout(m);
			l.setOrientation(LinearLayout.VERTICAL);
			super.addView(l, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
		} 
		onInit(isInEditMode());
	} 
 
	public ViewGroup getViewGroup(){
		return (ViewGroup) getChildAt(0);
	} 
	/** 
	 * addView to LinearLayout(Vertical) 
	 * width: dp 
	 * height: dp 
	 */ 
Contextual code suggestions in your IDE  Get Codota for Java