Blankj / AndroidUtilCode

:fire: Android developers should collect the following utils(updating).
https://blankj.com/2016/07/31/android-utils-code/
Apache License 2.0
33.31k stars 10.69k forks source link

Toast gravity 设置后再恢复无效? #311

Closed yangtuhua closed 6 years ago

yangtuhua commented 7 years ago

ToastUtils.setGravity(Gravity.CENTER, 0, 0); View toastView = ToastUtils.showCustomShort(R.layout.toast_center_long); TextView tvTips = toastView.findViewById(R.id.tv_tips); tvTips.setText(msg);

    new Handler().post(new Runnable() {
        @Override
        public void run() {
            ToastUtils.setGravity(Gravity.BOTTOM, 0, 0);//此行代码不起作用,下次吐丝还是在Center
        }
    });
Blankj commented 7 years ago

看demo,你这什么逻辑啊,前面设置了center,show出来了肯定是在中间了啊,你后面设置了底部,为啥不再show呢,不show会变?