Code example for LinearLayout.LayoutParams

Methods: setMargins

0
        mInputField.setGravity(Gravity.FILL_HORIZONTAL);
        mInputField.setTextAppearance(context, android.R.attr.textAppearanceMedium);
        mInputField.setInputType(InputType.TYPE_CLASS_TEXT);
        mInputField.setImeOptions(EditorInfo.IME_ACTION_DONE);
 
        lp = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
        lp.setMargins(20, 10, 20, 20);
        view.addView(mInputField, lp);
 
        return view;
    } 
 
    public void setFinishTextInputListener(FinishTextInputListener listener) {
        mListener = listener;
    } 
 
    public void show(int title, int text) {
        show(title, text, "");
    } 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE