SQLiteNoob
SQLiteNoob

Reputation: 3022

The Efficiency of Views

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 TextViews in an app's layout - you'll get this warning.

But if you put 10 TextViews 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

Answers (1)

Ted Hopp
Ted Hopp

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

Related Questions