I have RecyclerView
with CardViews
. Do my list work slower if I set layout_height="wrap_content"
rather then layout_height="const_value_dp"
in CardView
?
CardView - layout_height="wrap_content" or const value - performance impact?
262 views Asked by AppiDevo At
2
There are 2 answers
0
On
One thing is for sure,
if you use layout_height="0dp"
or layout_width="0dp"
with weightSum in its parent layout then it causes bad performance.
Layout weights require a widget to be measured twice. When a LinearLayout with non-zero weights is nested inside another LinearLayout with non-zero weights, then the number of measurements increase exponentially.
No there should not be any performance impact of
wrap_content
overconstant_value_dp
its only the programmers choice.