Popupwindow (4) Translucent Popupwindow

Source: Internet
Author: User

Each popupwindow has a view, put View.setalpha (0.5f);

 Public classCustomactionproviderextendsActionproviderImplementsOnmenuitemclicklistener, Onclicklistener, Ontouchlistener, Onkeylistener {Private FinalContext context;//Context    PrivateView Actionview;//Action View    PrivatePopupwindow Mpopupwindow;//There's a view,view in the popup window that looks like a menu.    PrivateView Mmenu;//display controls in the popup window        Private voidInitpopupmenu () {layoutinflater Lif=Layoutinflater.from (context); Mmenu= Lif.inflate (R.layout.custom_popup_window,NULL); mmenu.setalpha (0 . 5f); Mpopupwindow=NewPopupwindow (Mmenu, WindowManager.LayoutParams.WRAP_CONTENT, Windowmanager.layoutparams.                        Wrap_content); /** Setbackgrounddrawable is very important, without this function the back key and the menu key to close Popwindow is troublesome, * after it, you do not have to set the control for Popwindow in the Setonkeyli Stener and Setontouchlistener * can support both back return and point Popwindow outside of the close Popwindow,*/mpopupwindow.setbackgrounddrawable (NewColordrawable (0x00000)); }
//...}

Popupwindow (4) Translucent Popupwindow

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.