How to set shape's opacity?

前端 未结 3 570

I already know how to set the opacity of the background image but I need to set the opacity of my shape object.

In my Android app, I have it like this:

3条回答
  •  隐瞒了意图╮
    2020-12-04 09:04

    use this code below as progress.xml:

    
    
        
            
                
                
            
        
    
        
            
                
                    
                
            
        
    
        
            
                
                    
                
            
        
    
    
    

    where:

    • "progress" is current progress before the thumb and "secondaryProgress" is the progress after thumb.
    • color="#00000000" is a perfect transparency
    • NOTE: the file above is from default android res and is for 2.3.7, it is available on android sources at: frameworks/base/core/res/res/drawable/progress_horizontal.xml. For newer versions you must find the default drawable file for the seekbar corresponding to your android version.

    after that use it in the layout containing the xml:

    
    

    you can also customize the thumb by using a custom icon seek_thumb.png:

    android:thumb="@drawable/seek_thumb"
    

提交回复
热议问题