How to set corner radiuses for the button in java code?

前端 未结 4 863
情深已故
情深已故 2020-12-11 05:06

I want to set the rounded corners without xml. How can I do it in java code?

Button b = new Button (this);
b.set???? (??) ;

I tried to wri

4条回答
  •  旧巷少年郎
    2020-12-11 05:57

    create a shape in your drawable folder and set the desired radius and set this drawable as background to your button:

    
    
            
        
            
                
            
        
    
    

提交回复
热议问题