Problem:
When scrollview and listview coexist, the listview displays only one row, and other rows cannot be displayed.
Solution:
Rewrite the listview as follows to solve the problem.
/** Solve the problem that when scorllview and listview coexist, the listview only displays one row but not all.
* @ Author caiyuan Huang
* 2014-9-26
*/
Public class customlistview extends listview {
Public customlistview (context ){
Super (context );
// Todo auto-generated constructor stub
}
Public customlistview (context, attributeset attrs ){
Super (context, attrs );
// Todo auto-generated constructor stub
}
Public customlistview (context, attributeset attrs, int defstyle ){
Super (context, attrs, defstyle );
// Todo auto-generated constructor stub
}
@ Override
Protected void onmeasure (INT widthmeasurespec, int heightmeasurespec ){
// Todo auto-generated method stub
Int expandspec = measurespec. makemeasurespec (integer. max_value> 2,
Measurespec. at_most );
Super. onmeasure (widthmeasurespec, expandspec );
}
}
9. solve the problem that the listview height cannot be fully displayed when scrollview and listview coexist.