views:

48

answers:

1

How to set transparent toast frame in android ? I want to it more transparent.

+2  A: 

You can set the background used for the Toast using the code below.

Toast toast = Toast.makeText(context, "Toast text", Toast.LENGTH_SHORT);
View view = toast.getView();
view.setBackgroundResource(/*your background resid*/);
toast.setView(view);
toast.show();

Basically you create the toast with makeText and then get the view set up by Android. Change the background for the view and then set the view back.

By using a background with a more transparent background than the default one you can get the effect you want.

Key