Android: SeekBar with custom drawable

前端 未结 6 1216
独厮守ぢ
独厮守ぢ 2020-12-31 00:06

I have SeekBar with custom drawable. Progress element is not rendered from left side exactly but it is moved to right. How can I avoid this?



        
6条回答
  •  旧时难觅i
    2020-12-31 00:14

    If your choices of color has a limit and is predefined. You can try to add XML files with Seekbars using different themes.

    Something like this:

    themed_seekbar_one.xml

    
    
    
    

    themed_seekbar_two.xml

    
    
    
    

    You can then inflate does views programatically like this:

    SeekBar seekbar = (SeekBar)getLayoutInflater().inflate(R.layout.themed_seekbar_xxx, null);
    

提交回复
热议问题