Android imitation bubble window implementation of drop-down menu bar example code

Function Description: click the drop-down button to display all entries. There are deletion and click functions. After clicking, the entries will be displayed.

Note: bubble window has no focus by default. Let the bubble window get the focus. If there are buttons and imagebuttons in the item of listview, Check@R_ 25_ 2419 @ and others will force the view to get the focus. At this time, the item of listview cannot get the focus, so it cannot be clicked. Solution: add the following attribute Android to the root layout of item: after the setting of descendantfocusability = "blocksdecedents", the button can get the focus, and other controls in item can also get the focus. If there are too many text, it will be covered by the following icon, First set the single line Android: singleline = "true" and then set the right margin to cover Android: padding = "40dp"

The following three items need to be added

Main layout file activity_ main.xml

Layout file item of each item_ list.xml

Logical code mainactivity.java

The above is the example code of Android imitation bubble window drop-down menu bar introduced by Xiaobian. I hope it will be helpful to you. If you have any questions, please leave me a message, and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>