【发布时间】:2015-10-26 03:04:50
【问题描述】:
有没有办法让 SnackBar 包装其文本内容?
你可以在下面查看我的问题:
如您所见,文本以“contact us at....”结尾,它应该显示整个消息。
谢谢!
【问题讨论】:
标签: android android-support-design snackbar
有没有办法让 SnackBar 包装其文本内容?
你可以在下面查看我的问题:
如您所见,文本以“contact us at....”结尾,它应该显示整个消息。
谢谢!
【问题讨论】:
标签: android android-support-design snackbar
我相信,snackbar 默认情况下将您限制为 2 行。
您可以尝试的一件事是将小吃栏中的 textview 设置为多行。像这样:
View snackbarView = snackbar.getView();
TextView textView = (TextView) snackbarView.findViewById(android.support.design.R.id.snackbar_text);
textView.setMaxLines(5); //set the max lines for textview to show multiple lines
让我知道这是否有效
【讨论】:
snackbar.view.findViewById<TextView>(com.google.android.material.R.id.snackbar_text).maxLines = 5