Reputation: 3022
If you place many views into an app's layout, there is a threshold (I think 70 views if I remember correctly) that will create an error saying that it is inefficient to have that many views.
Let's say you put 70 TextView
s in an app's layout - you'll get this warning.
But if you put 10 TextView
s into a Custom View
- TenView
- and put 7 TenViews
, you don't run into this error, even though the same number of TextViews are being drawn.
Why is it more efficient to wrap multiple views into a Custom View instead of using them individually in the layout file?
Upvotes: 1
Views: 62
Reputation: 234795
It isn't more efficient. You're just disguising the inefficiency to the point that Android lint tool doesn't recognize the problem.
Perhaps you should rethink your layout. Why do you need 70 text views to start with?
Upvotes: 7