Discrete seekbar in Android app?

后端 未结 7 1721
感动是毒
感动是毒 2020-12-29 04:46

I would like to create a seekbar for an Android app that allows the user to select a value between -5 and 5 (which maps to \"strongly disagree\" and \"strongly agree\"). How

7条回答
  •  感动是毒
    2020-12-29 05:14

    The Seekbar works great for discrete values. We use a Seekbar for discrete data as shown below. To show which item is selected, we just change the font of the selected text view so it is bigger. You could also highlight by changing the background color or something. It works pretty well. You will want to call setMax(11) on the seek bar, and then in your code you need to translate between the range (0 through 11) and (-5 through 5) appropriately.

     
         
        
        
        
        .....
      
    
      
    
    

提交回复
热议问题