안드로이드에서 24시간 SeekBar 또는 ProgressBar를 만드는 방법 (How to create 24hour SeekBar or ProgressBar in android)


문제 설명

안드로이드에서 24시간 SeekBar 또는 ProgressBar를 만드는 방법 (How to create 24hour SeekBar or ProgressBar in android)

24시간 기간을 나타내려는 SeekBar가 있습니다. 각 단계는 5분을 의미하고 싶습니다. 이게 가능해? 기본 SeekBar의 최대값은 100단위입니다. 각 단계는 1 단위라고 생각합니다. 10,000 단위 가능성에 대해 들었던 것을 기억합니다. 어쨌든 내가 성취하고자 하는 것이 가능한가? 5분 간격/단계로 24시간?


참조 솔루션

방법 1:

Just update the onProgressChanged method.

int interval = 5;
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) 
{
    progress = (progress/interval) * interval;
    seekBar.setProgress(progress);   
}

Also set the max value for the Seekbars xml. 1440 represents the number of minutes in 24 hours

<SeekBar android:id="@+id/SeekBar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="1440"/> 

(by learnerSmittey)

참조 문서

  1. How to create 24hour SeekBar or ProgressBar in android (CC BY‑SA 2.5/3.0/4.0)

#android-progressbar #Android #android-layout






관련 질문

목록 보기 항목의 보기는 화면에서 보기를 스크롤한 후 원래 상태로 돌아갑니다. (listview item's view returns to original state after scroll the view off the screen)

Android의 비동기 클래스에서 FTP 다운로드에 진행률 표시줄을 표시하는 방법은 무엇입니까? (How to show the progress bar in FTP download in async class in Android?)

Android에서 진행률 표시줄의 ListView (ListView of Progress Bars in android)

안드로이드에서 24시간 SeekBar 또는 ProgressBar를 만드는 방법 (How to create 24hour SeekBar or ProgressBar in android)

Android: ProgressBar가 활동에서 이상하게 보입니다. (Android: ProgressBar looks strange in activity)

Android에서 기본 ProgressDialog 원 색상을 변경하는 방법 (How to change default ProgressDialog circle color in android)

Android: 사이에 공백이 있는 맞춤 원 ProgressBar (Android: Custom circle ProgressBar with spaces in between)

정적 수평 진행률 표시줄 Android (Static horizontal progress bar android)

Android progressBar setVisibility()가 작동하지 않음 (Android progressBar setVisibility() not working)

비동기 작업의 게시 진행률 (Publishing progress in async task)

BaseActvity/BaseFragment의 ProgressBar 관리 (ProgressBar management in BaseActvity/BaseFragment)

진행 중인 경고 대화 상자가 닫히거나 취소되지 않음 (Alertdialog running ongoing dosen't dismiss or cancel)







코멘트