Android horizontal progress bar?

后端 未结 1 520
忘了有多久
忘了有多久 2020-12-28 19:58

I\'d like to implement a progress bar like this

\"enter

Please help how can I

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-28 20:36

    I saw that a lot of people are looking on this post so I thought that I should edit it and share an example:

    Note (this example is not complete, it's still in progress but I guess it's a starting point)

    GitHub: Github Example

    enter image description here

    The important part in this example is below: Create in drawable a xml file custom_progress_bar_horizontal.xml and add the content below.

    
    
    
        
            
                
                
                
            
        
        
            
                
                    
                    
                
            
        
    
    

    Add the following code in styles.xml

    
    

    After you have added the style in your activity layout add:

        
    

    The progress dispaly below in a frame it's a little tricky because you need to extend the ProgressBar class and make the changes there.

    I will leave here some examples and notify when I will add them in my github project.

    Great example if you want to disaply the progress in your way: NumberProgressBar

    Other progress bar examples:

    Custom progress bar 1

    Custom progress bar 2

    Custom progress bar 3

    UPDATE:

    Also check DiscreteSeekBar this is a great github project.

    Gradle: compile 'org.adw.library:discrete-seekbar:1.0.1'

    Cheers,

    0 讨论(0)
提交回复
热议问题