val toast = Toast(context)
val inflate =View.inflate(context, R.layout.max_value_toast_item,null )//自定义布局
toast.view = inflate //将自定义view设置给toast
toast.setGravity(Gravity.CENTER, 0, -100) //自定义位置
toast.show()
自定义toast显示view与位置
最新推荐文章于 2021-05-25 16:12:02 发布