Android how to create triangle and rectangle shape programmatically?

前端 未结 7 1036
一整个雨季
一整个雨季 2020-11-29 01:15

How can we create ballon drawable shape as below. where we can change the color of it dynamically. \"enter

7条回答
  •  孤城傲影
    2020-11-29 02:01

    Here it is XML for triangle and rectangle. save it inside drawable folder.

    triangle.xml

    
    
        
            
                
                    
                    
                
            
        
    
    

    rectangle.xml

    
    
         
        
           
        
      
    
    

    and layout for shape you require.

    
    
        
    

    enter image description here

    set margin according you required.

    Source

提交回复
热议问题