62、自定义Toast

    xiaoxiao2022-06-30  188

    public static void showImageMessageLong(Context context, String message) { View toastRoot = LayoutInflater.from(context).inflate(R.layout.toast, null); Toast toast = new Toast(context); toast.setGravity(Gravity.CENTER, 0, 0); toast.setView(toastRoot); TextView tv = toastRoot.findViewById(R.id.message); tv.setText(message); toast.show(); }

    最新回复(0)