官方文档中所述的 Android R 仅影响 「text toast」 ,而自定义的 toast 不受影响 调用无效,仅影响 text toast 如图,在 test toast 中调用 setGravity 和 setMargin 方法,但 toast 位置并未居中 setView() 被弃用 **setView() **方法被标记弃用 「Deprecated」 表示该功能目前仍可以使用,但可能会在将来的 Android 版本中删除。建议开发人员避免长期使用此功能