i'm trying to add two listviews to linearlayout but only first Listview is shown, anyone does know why?
private void populateListView(ConstraintLayout root, List<Product> products){
....
ConstraintLayout.LayoutParams newParams = new ConstraintLayout.LayoutParams(
ConstraintLayout.LayoutParams.MATCH_PARENT, ConstraintLayout.LayoutParams.MATCH_PARENT);
...
ListView listView = (ListView)getLayoutInflater().inflate(R.layout.list_view_product, null);
listView.setId(View.generateViewId());
listView.setLayoutParams(newParams);
...
ListView listView2 = (ListView)getLayoutInflater().inflate(R.layout.list_view_product, null);
listView2.setId(View.generateViewId());
listView2.setLayoutParams(newParams);
...
LinearLayout linearLayoutView = (LinearLayout)root.findViewById(R.id.fragment_ll_home);
linearLayoutView.addView(listView2,0);
linearLayoutView.addView(listView,1);
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…