2015-11-09 1 views

ответ

0

бездельничать с этим:

private void buildEditText() { 
    LinearLayout layout = new LinearLayout(getActivity()); 
    LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); 
    layout.setLayoutParams(layoutParams); 
    layout.setOrientation(LinearLayout.VERTICAL); 

    EditText editText = (EditText) inflater.inflate(R.layout.your_custom_layout, null); // Here is your reference 
    LayoutParams textViewParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); 
    editText .setLayoutParams(textViewParams); 
    layout.addView(textView); 
    this.editText = editText ; 
    this.editText .setImeOptions(EditorInfo.IME_ACTION_DONE); 
    editText .setText("If you have some text to enter"); 

    editText .setHint("Some hint"); 
    editText .setInputType(EditorInfo.TYPE_TEXT_FLAG_CAP_CHARACTERS); 

    parentView.addView(layout); 
} 

 Смежные вопросы

  • Нет связанных вопросов^_^