Seekbar where I can change both min max value with 2 thumbs

后端 未结 2 1483
挽巷
挽巷 2021-01-22 08:54

I want to have a thumb for both min and max for my seekbar. You should be able to drag both thumbs independently.

2条回答
  •  一个人的身影
    2021-01-22 09:46

    Just use the RangeSlider in Material Components and the method setValues()

        
    

    with:

    RangeSlider slider = findViewById(R.id.slider);
    slider.setValues(1.0f,5.0f);
    

    You can also use:

        
    

    with res/values/arrays.xml:

    
      
        1.0
        5.0
      
    
    

    Note: This requires a minimum of version 1.2.0-beta01

提交回复
热议问题