Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I set the Toast width and height? If not,Can you Support? #46

Closed
Chenayi opened this issue Oct 19, 2017 · 1 comment
Closed

Can I set the Toast width and height? If not,Can you Support? #46

Chenayi opened this issue Oct 19, 2017 · 1 comment
Labels

Comments

@Chenayi
Copy link

Chenayi commented Oct 19, 2017

Can I set the Toast width and height? If not,Can you Support?

@GrenderG
Copy link
Owner

Hello, there is no direct way to do that, but as a workaround you can get the text inside the root View and set the width and height there:

Toast toast = Toasty.success(this, "Hi there");
toast.getView().findViewById(R.id.toast_text).setLayoutParams(new LinearLayout.LayoutParams(widht, height));
toast.show();

(Or get the root View and set padding to it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants