I work with ListViewwhere list items have a background resource. I want to get rid of this overflow as much as I can. I know about the “Case Case Study” on the Romain Guy blog, but it's hard for me to get the list view fully optimized. Code for a simplified example is shown at the bottom of this post. As an example, we can only cite the “new activity” master with a list toss. My question is based on this example. Here is a screenshot with the inscription and without the crossed out marking of the initial, non-optimized case:

Make sure that the page has a gray background (this is a texture in my real project) and the list items have a white background (these are nine patches in my real project). Overdraw is dramatic, no part of the screen is drawn only once, and list items are displayed three times before they display the letter of content.
It’s easy to get rid of the background representation of the decor in Windowand cut out the full overdraw layer. If the list contains enough elements to fill the entire screen, I can also lower the background ListViewand get to a very good place:

, , , . , . ( ), , :

, , . , overdraw?
, :
:
public class MainActivity extends Activity {
private static final String[] DATA = { "Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", "Hotel", "India", "Juliet" };
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ListView lv = (ListView) findViewById(android.R.id.list);
lv.setAdapter(new ArrayAdapter<String>(this, R.layout.activity_main__list_item,
android.R.id.text1, data));
}
}
:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="#FFDDDDDD"
android:text="Page header information" />
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#FFDDDDDD"
android:divider="@null" />
</LinearLayout>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@android:color/white" />