Back to Browse

TextInputLayout in Dialog in Sketchware

3.7K views
Feb 1, 2019
5:08

This video shows how to use a add an EditText in a TextInputLayout in Dialog Box in Sketchware android project. The code used in this video: final EditText edittext1 = new EditText(MainActivity.this); edittext1.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); edittext1.setHint("Fruit name"); android.support.design.widget.TextInputLayout textinput1 = new android.support.design.widget.TextInputLayout(MainActivity.this); textinput1.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); textinput1.addView(edittext1); dialog_add.setView(textinput1); // To get text from EditText, create a String variable 'name' and use following code: name = edittext1.getText().toString();

Download

0 formats

No download links available.

TextInputLayout in Dialog in Sketchware | NatokHD