How to use setDuration() method in SnackBar (Android Design Support Library)

前端 未结 7 1833
不知归路
不知归路 2020-12-23 16:09

From Documentation: parameter duration - either be one of the predefined lengths: LENGTH_SHORT, LENGTH_LONG, or a custom duration in milliseconds. But I can

相关标签:
7条回答
  • 2020-12-23 16:59

    This code working perfectly for me try this

    Snackbar.make(view, "Hello SnackBar", Snackbar.LENGTH_LONG)
            .setAction("Its Roy", new View.OnClickListener() {
                @Override
                public void onClick(View v) {
    
                }
            })
            .setDuration(10000)
            .setActionTextColor(getResources().getColor(R.color.colorAccent))
            .show();
    
    0 讨论(0)
提交回复
热议问题