How can I work around Android issue 9161, where bottomRightRadius and bottomLeftRadius are swapped?

前端 未结 5 1967
南方客
南方客 2020-12-05 14:35

My goal:

\"Figure
Figure 1: The Goal

So, before I knew about the issue, her

5条回答
  •  遥遥无期
    2020-12-05 15:16

    This feels like such a hack, but it worked.

    The buttons were originally made up of (1) an outer shadow, (2) a top-half gradient and (3) a bottom solid color. Here's what I did:

    1. Made the top and bottom halves each rounded on all four corners. This left (1) a gap in the middle of the left and right sides and (2) rounded corners on the right.
    2. Created a small rectangle to fill in the gap in the left middle.
    3. Created another small rectangle to both fill in the gap in the right middle and make the top and bottom corners on the right side square.

    Here's an example of the XML for the normal state of the left button.

    
    
    
        
        
    
            
                
                
            
        
    
        
    
            
                
                
            
        
    
        
        
    
            
                
            
        
    
        
    
            
                
            
        
    
        
        
    
            
                
            
        
    
        
    
            
                
            
        
    
    

    I did, however, lose the gradient on the top half, but I can live with the two-tone button. Here's what the result looks like:
    Two Buttons Solution

提交回复
热议问题