Change the appearance of Android PopUpWindow content

I'm just wondering if there is a way to change the presentation of the contents of PopUpWindow when it is already open.

According to the documentation for setContentView (View contentView):
This method does not work if called on a popup.

I tried to hide the content view using getContentView (). setVisibility (View.GONE) and change it, but this does not work either.

+4
source share
1 answer

You can try extending the class PopUpWindowto call setContentViewin your constructor. Sort of.-

public class CustomPopUpWindow extends PopUpWindow {
    public DialogParent(Context context) {
        super(context);
        setContentView(R.layout.your_layout);
    }
}
0
source

All Articles