Android - Can't create simple rectangle shape… UnsupportedOperationException?

前端 未结 1 1619
隐瞒了意图╮
隐瞒了意图╮ 2021-01-11 18:35

I\'m having trouble creating a simple rounded rectangle using XML. Every time I try to add the \"corners\" element to the custom shape I get:

java.lan

1条回答
  •  滥情空心
    2021-01-11 18:39

    So, I was just playing around with this a bit and I changed a couple of lines in the rounded_rectangle.xml to get it working. See below:

    
     
            
    
        
    
         
    
         
    
    

    I only wish Google would put out a proper reference doc for creating XML-based shapes. After hours (4+) of hunting down examples on the Web, I feel like it's still a guessing game as to what elements/attributes are supported in these types of XML documents. Sorry for the mini-rant.

    I hope this helps someone else.

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