Android: Creating a Circular TextView?

后端 未结 11 1600
我在风中等你
我在风中等你 2020-12-04 08:53

My current simple XML is below, however i would like the 3 TextViews within it to be circular, rather than rectangular.

How can I change my code to do so?

         


        
11条回答
  •  佛祖请我去吃肉
    2020-12-04 09:41

    Much of the Answer here seems to be hacks to the shape drawable, while android in itself supports this with the shapes functionality. This is something that worked perfectly for me.You can do this in two ways

    Using a fixed height and width, that would stay the same regardless of the text that you put it as shown below

    
    
    
    
        
    
    
    
    
    

    Using Padding which re-adjusts the shape regardless of the text in the textview it as shown below

    
    
    
    
    
    

    semi_standard_margin = 4dp

提交回复
热议问题