Android 흐르는 텍스트 구현하기

98oys·2023년 7월 16일
0

안드로이드

목록 보기
20/20
  <TextView
                android:id="@+id/marqueeTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:background="#05B1FF"
                android:ellipsize="marquee"
                android:focusable="true"
                android:focusableInTouchMode="true"
                android:marqueeRepeatLimit="marquee_forever"
                android:singleLine="true"
                android:text="보안정책에 따라 화면을 캡쳐할 수 없습니다. 위변조 방지 중입니다."
                android:textColor="@color/white"
                android:textStyle="bold"
                app:layout_constraintTop_toTopOf="parent" />

흐르는 텍스트를 구현하기 위해서 설정해야하는 TextView의 옵션은 5가지 입니다.

  • ellipsize : TextView의 텍스트가 범위를 초과한 경우 생략 기호 노출 위치 지정
  • marueeRepeatLimit : 반복 횟수
  • singleLine : 한줄 표시 여부
  • focusable
  • focusableInTouchMode

ellipsize

  • none (0) : 사용하지 않음
  • start (1) : 텍스트의 시작 위치
  • middle (2) : 텍스트 중간 위치
  • end (3) : 텍스트 끝 위치
  • marguee (4) : 텍스트

profile
Android Developer, Department of Information and Communication Engineering, Inha University

0개의 댓글