Simple listview nested GridView under Android imitation bar

Listview is a simple instance of a nested GridView

My project wants to implement a listview in which each item is nested with a GridView and topics at the top, such as

As we all know, the most important problem with the nested GridView of listview is the sliding conflict in the nested state. How to solve it? For those who like lengthy and uncommented code, please click here. This article is similar to others. However, in the absence of comments, I found a little problem:

Even if the GridView above is customized, we will simply paste the main method getview (...) of the listview adapter

As long as the adapter of GridView is defined again, it will be completed (I believe everyone should be familiar with the adapter by this time, so I won't comment, ha, please forgive me for being lazy)

I won't give you the layout. Just a few simple item layouts. Please define them yourself

Summary: the methods to solve sliding conflicts or those involving click, move and other attributes can be well solved by rewriting event distribution with custom controls. However, for the same ViewGroup, there is no way to intercept by calling onintercepttouchevent (motionevent EV) like the view component, so we can only find another method. The key is to rewrite the onmeasure (int widthmeasurespec, int hightmeasurespec) method to fix the "control size" of the GridView, This will not conflict with another sliding event.

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

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
分享
二维码
< <上一篇
下一篇>>