Use of PopupWindow and use of PopupWindow

Source: Internet
Author: User

Use of PopupWindow and use of PopupWindow

I recently made a project login interface, using a login interface similar to QQ

The main difference is that a drop-down menu is unfamiliar.

Use PopupWindow. Here we mainly record the main process and main code for future viewing.

1. The first is the storage of historical data. I use SQLiteDataBase

2. Mainly record the use of PopupWIndow

The main problems during use are as follows: 1. Click the window to disappear and collapse it

2. The window has a ListView to respond to the Item click event.

Window is unfocusable by default. It cannot obtain the focus and does not seem to be able to receive click events. setTouchInterceptor can receive events and click events are received by the Activity at the next layer. Although the first requirement can be met, but the second one is not sure ....

(It seems that the focus cannot be obtained, so only information can be displayed, and events cannot be accepted, just like floating on top)

You can click the View on the Window to obtain the focus.

Solution:

   

The window can get the focus. The following two methods are used to achieve requirement 1 (the icon is put in OnDismiss)

Popup. setOutsideTouchable (true );
Popup. setBackgroundDrawable (new BitmapDrawable ());

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.