8_4 고급위젯 바(Bar)

오현석·2022년 4월 29일
0

안드로이드 위젯에 바(Bar)는 다양한 종류를 가지고 있다

  • 프로그레스바(ProgressBar)

  • 시크바(SeekBar)

  • 레이팅바(RatingBar)


프로그레스바(ProgressBar)

  • 작업의 진행 상태를 제공한다

  • 바(bar) 또는 원 형태로 제공

  • 바 형태는 진행정도 확인이기 가능, 원 형태는 진행중 상태만 보여줌

  • "max" : 범위를 지정한다

  • "progress" : 진행된 지점을 지정한다

  • "secondaryProgress" : 보조 진행 지점을 지정한다

<ProgressBar
    style="?android:attr/progressBarStyleHorizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="20dp"
    android:max="100"
    android:progress="20"
    android:secondaryProgress="20"/>

 <ProgressBar
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="20dp"
        android:max="100"
        android:progress="20"
        android:secondaryProgress="20"/>
   


시크바(SeekBar)

  • 프고그레스바의 하위 클래스 이다

  • 터치로 임의 조절이 가능하다

  • 음량 또는 동영상 위치 조절등에 사용한다

<SeekBar
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:progress="40"/>


레이팅바(RatingBar)

  • 별 모양으로 진행상태를 표시한다

  • 선호도를 나타낼때 주로 사용한다

  • "numStars" : 별의 개수를 정한다

  • "rating" : 초기값 지정

  • "stepSize" : 채워지는 개수 정하기

<RatingBar
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="30dp"
    android:numStars="5"
    android:rating="2.5"
    android:stepSize="0.5"/>

profile
지망생

0개의 댓글