Android: Creating a Circular TextView?

后端 未结 11 1606
我在风中等你
我在风中等你 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:44

    1.Create an xml circle_text_bg.xml in your res/drawable folder with the code below

    
    
         
    
        
        
        
    
    

    2.Use circle_text_bg as the background for your textview. NB: In order to get a perfect circle your textview height and width should be the same.Preview of what your textview with text 1, 2, 3 with this background should look like this

提交回复
热议问题