How to set transparent toast frame in android ?

<br />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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s