TextView

WACK·2023년 6월 2일
0

TextView 속성

  • android:text – TextView 에 출력되는 문자열 지정
  • android:textColor – 문자열 컬러
  • android:textSize – 문자열 사이즈
  • android:textStyle – 문자열 스타일
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="helloworld"
android:textColor="#FF0000"
android:textSize="20sp"
android:textStyle="bold"/>
  • android:autoLink
  • TextView 에 출력되는 문자열을 분석해 자동 링크 추가
  • web, email, phone 등을 값으로 지정
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Test - 웹페이지 : https://Test.kr/, 전화번호 : 02-3667-7304, 이메일 : test@test.kr"
android:autoLink="web|email|phone"/>
  • android:maxLines - 문자열이 특정 라인 까지만 출력되게 설정
  • ellipsize – 줄임표시, end, start, middle
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/long_text"
android:maxLines="3"
android:ellipsize="end"/>
profile
앱 개발자 지망생

0개의 댓글