对话框片段后面的小吃条

问题描述 投票:0回答:1

当对话框片段中的输入为假时,我想显示一个小吃栏错误。

出现小吃栏,但其高度低于对话框片段之一,因此它变暗。

这不是我的图像,但要点是相同的:

enter image description here

如何使此小吃栏显示为灰色?

android android-alertdialog android-snackbar
1个回答
0
投票
Snackbar snackbar = Snackbar
        .make(coordinatorLayout, "No internet connection!", Snackbar.LENGTH_LONG)
        .setAction("RETRY", new View.OnClickListener() {
            @Override
            public void onClick(View view) {
            }
        });

// Changing message text color
snackbar.setActionTextColor(Color.RED);

// Changing action button text color
View sbView = snackbar.getView();
TextView textView = (TextView) sbView.findViewById(android.support.design.R.id.snackbar_text);
textView.setTextColor(Color.YELLOW);
snackbar.show();
© www.soinside.com 2019 - 2024. All rights reserved.