Android base Control--popupwindow mimic iOS bottom pop-up window

Source: Internet
Author: User

In the H5 fiery era, many frameworks are out of the bottom of the popup window control, in H5 is called pop-up menu Actionsheet, today we also imitate an iOS bottom pop-up window, drawing on the Apple QQ select Avatar function

Don't talk a lot, first of all, to achieve today

Open code for the entire Popupwindow

Step Analysis:

    • Layout of the Popupwindow
    • Creation of Popupwindow
    • Popupwindow Adding animation effects
    • Popupwindow Setting the background shadow
    • Popupwindow Monitor Click events
    • Get the height of the Navigationbar

Popupwindow layout: In layout, design the layouts we need

The effect is:

Popupwindow creation: This creation is the same as our normal control creation method

Popupwindow Add animation effects: We create a Anim folder, create our out and in animation effects, and then add our animations to the style

Popupwindow Setting the background shadow: Set the transparency to 0.5 when the pop-up window is open, and set the transparency to 1 when the popup disappears

Popupwindow Monitor Click event: Listen to our popupwindow inside the control's Click event

Get the height of the Navigationbar: Here you need to fit some phones without navigationbar some phones have, here with the presence of Navigationbar to demonstrate

On the mobile phone where Navigationbar is present, set the location where its popupwindow appears

On a phone without navigationbar, set the location of its Popupwindow

Github:https://github.com/androidhensen/iospopupwindow

Android base Control--popupwindow mimic iOS bottom pop-up window

Related Article

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.