Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
Tags
- android daum map
- 안드로이드 라이브러리
- HTTP
- dynamiclink
- 안드로이드컴포즈
- thread
- RecyclerView
- 동적 링크
- 안드로이드 카카오 지도
- 애드몹광고
- JetpackCompose
- component
- android 지도
- 안드로이드
- 애드몹배너
- 아키텍처
- 안드로이드광고
- 파이어베이스
- 다이나믹 링크
- Firebase
- 클린 아키텍처
- Android 애드몹
- Android
- 컴포넌트
- 선언형UI
- glide
- android kakao map
- Clean Architecture
- 젯팩컴포즈
- ImageView
Archives
- Today
- Total
코딩스토리
[Android] EditTest 기본 사용법 본문
activity_main.xml
<EditText
android:id="@+id/et_sample"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="글자를 입력하세요"/>
MainActivity
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.EditText;
public class MainActivity extends AppCompatActivity {
EditText editText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
editText = findViewById(R.id.et_sample);
//EditText에 글 넣기
editText.setText("글을 입력하세요.");
//EditText에 쓰여진 글 가져오기
String str = editText.getText().toString();
//ExitText 최대 줄 개수 설정
editText.setMaxLines(10);
//editText 글자 색 설정
editText.setTextColor(Color.WHITE);
//editText 힌트 글자색 설정
editText.setHintTextColor(Color.BLUE);
//editText 배경색 설정
editText.setBackgroundColor(Color.BLACK);
//editText 한줄만 사용
editText.setSingleLine();
}
}

'Android > Component(Widget) 사용법' 카테고리의 다른 글
| [Andriod] TextView 기본 사용법 (0) | 2019.06.25 |
|---|
Comments