Tôi bật lớp phủ Overdraw GPU trong cài đặt của nhà phát triển và nhận thấy ứng dụng của tôi không được tối ưu hóa và tôi không chắc chắn nên thay đổi nó ở đâu. Đây là một hình ảnh của nó.Tối ưu hóa và giảm GPU Overdraw - Android
Các phần màu đỏ đều là một phần của một ListView và vì vậy đó là nơi mà tôi không biết làm thế nào để tối ưu hóa nó trong khi vẫn giữ phong cách tương tự. Đây là Layout.xml cho từng phần ListView:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/background_card"
android:orientation="horizontal"
android:padding="5dip" >
<ImageView
android:id="@+id/list_image"
android:layout_width="50dip"
android:layout_height="50dip"
android:src="@drawable/gta5thumb"
android:padding="3dip"
android:background="@drawable/image_bg"
android:layout_centerVertical="true"/>
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/list_image"
android:layout_toRightOf="@id/list_image"
android:text="Grand Theft Auto 5"
android:textColor="#040404"
android:textSize="18sp"
android:layout_marginLeft="4dp"
android:textStyle="bold"/>
<TextView
android:id="@+id/date1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:textColor="#343434"
android:textSize="14sp"
android:layout_marginTop="1dip"
android:layout_toRightOf="@id/list_image"
android:layout_marginLeft="4dp"
android:text="17th September 2013" />
<TextView
android:id="@+id/date2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/date1"
android:textColor="#343434"
android:textSize="14sp"
android:layout_marginTop="1dip"
android:visibility="visible"
android:layout_marginLeft="4dp"
android:layout_toRightOf="@id/list_image"
android:text="17th September 2013" />
<TextView
android:id="@+id/date3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#343434"
android:textSize="14sp"
android:layout_marginLeft="4dp"
android:text="17th September 2013"
android:layout_below="@+id/date2"
android:layout_toRightOf="@+id/list_image"/>
<TextView
android:id="@+id/platforms"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="@id/title"
android:gravity="right"
android:text="360, PS3"
android:layout_marginRight="3dip"
android:textSize="12sp"
android:textColor="#10bcc9"
android:textStyle="bold"/>
<!-- Rightend Arrow -->
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/arrow"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
Tôi thực sự bị mất với sắp xếp này ra và tôi rất vui để cung cấp cho bất kỳ tập tin khác mà bạn có thể muốn giúp giảm bớt GPU Vẽ quá mức đó đang xảy ra. Tôi không chắc chắn nên làm gì vì nó là một ListView và do đó không thể thay đổi dễ dàng. Hãy nhớ rằng phong cách cần được giữ càng gần càng tốt.