본문 바로가기
개발/안드로이드

TextInputLayout TextInputEditText 사용하기

by 철권 2018. 9. 6.
728x90

*화면 설정

<android.support.design.widget.TextInputLayout

    android:id="@+id/tl1line"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginTop="17dp">

<android.support.design.widget.TextInputEditText
android:id="@+id/et1line"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:hint="1:1-16" />

</android.support.design.widget.TextInputLayout>
*변수 선언
private TextInputLayout ti_1;
private AppCompatEditText et_1;
ti_1 = (TextInputLayout) findViewById(R.id.tl1line);
et_1 = (AppCompatEditText) findViewById(R.id.et1line);
Editable et1line = et_1.getText();

String str1line = et1line.toString();


728x90
반응형