Setting background color on toast makes it rectangular

前端 未结 2 745
闹比i
闹比i 2021-01-18 18:45

If I set the background color of my Toast with

            t.getView().setBackgroundColor(
                    ctx.getResources().getColor(R.co         


        
2条回答
  •  礼貌的吻别
    2021-01-18 19:27

    There is no way to prevent that. The default background for the toast is a drawable that defines the rounded corners. If you want rounded corners in a different color, you'll have to define your own shape drawable.

提交回复
热议问题