The popwindow is blocked by the meizu virtual key, and the popwindow virtual block

Source: Internet
Author: User

The popwindow is blocked by the meizu virtual key, and the popwindow virtual block

In the previous project, we made a sharing function, called a third party of umeng, and the function was perfectly implemented and shared. However, during the test, I shared the pop-up popwindow with the meizu X4 mobile phone and was blocked by the virtual key of the mobile phone. I found a lot of information on the Internet, saying that I could disable the virtual key of the mobile phone, but it does not seem to be logical. When I see qq, I will not be blocked. I admire how qq's great gods do it. After constantly searching for popwindow examples on the internet, I finally found that when setting the height of popwindow, I set it to wrap_content, here I think it is necessary to explain the differences among wrap_content, match_parent, and fill_parent:

 

1) fill_parent

Setting the layout of a component to fill_parent will forcibly extend the component to fill as much space as possible in the layout unit. This is basically the same as the dockstyle attribute of the Windows Control. Setting a top layout or control to fill_parent will forcibly overwrite the entire screen.

2) wrap_content

Setting the size of a view to wrap_content will forcibly extend the view to display all the content. The TextView and ImageView controls are used as examples to set wrap_content to completely display the internal text and images. The layout element is changed based on the content. Setting the size of a view to wrap_content is basically equivalent to setting the Autosize attribute of a Windows Control to True.

3) match_parent
In Android2.2, match_parent and fill_parent are the same. The two parameters have the same meaning. match_parent is more appropriate, so both words can be used from 2.2. If you want to use a lower version, you need to use fill_parent.

In this case, you only need to set the height of popwindow to match_parent so that it will not be blocked by the virtual keyboard that comes with your phone.

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.