Reputation: 125
I would like to be able to either blur or dim the layout background when I show my popup window Like this.how do this pls help me.
This my code:
LayoutInflater inflater = (LayoutInflater) ResidentActivity.this
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(
R.layout.activity_appselection,
(ViewGroup) findViewById(R.id.popuplayoutelement));
pwindo = new PopupWindow(layout, 470, 540, true);
pwindo.showAtLocation(layout, Gravity.CENTER, 0, 45);
my output show this
but i need like this
Upvotes: 2
Views: 8458
Reputation: 1051
Declare the main parent in your layout like this for example:
RelativeLayout rl = (RelativeLayout)findViewById(R.id.relativeLayout);
Then when you show your popup also add this statement.
rl.setAlpha(0.5F);
This will set alpha to 50% in the layout. You can tweak as necessary.
Upvotes: 5