简体   繁体   中英

How to set SeekBar progress with a long integer? (or alternatives)

I need some help with an Android app. I want to use SeekBars to set a certain value but the value should be able to be a long (because I need such high numbers). Are there good custom SeekBars to import? (GitHub link would be great)

The normal SeekBar only supports normal integers as far as I know and casting to int is no option.

You can instead use percentage formula.

  • Set max of SeekBar to 100,
  • Current position equals (int)current_long/total_long * 100

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM