Hardware Acceleration in ListView

Is there a way to force hardware acceleration in a ListView. I have a ListView with over 400 items with an icon, scrolling is very slow. Each item has the same icon. I also added ViewHolder. In the manifest file, I turned on hardware acceleration. When I run this code:

ListView list_new = (ListView) findViewById(R.id.listview01); list_new.isHardwareAccelerated(); 

It returns false. My phone is a Nexus S with Bean Jelly. How can I get hardware acceleration?

EDIT: Here is my ListView:

 <ListView android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="match_parent" android:persistentDrawingCache="scrolling" android:hardwareAccelerated="true" android:fastScrollEnabled="true" android:scrollingCache="true" android:smoothScrollbar="true" > </ListView> 
+4
source share
2 answers

Not all View suport hardwareAccelerated. Use HardwareAccelerated to draw on canvas. To use ListView, use

 <ListView ... android:smoothScrollbar="true"; ... > 
+1
source

in your android:layerType="hardware" list android:layerType="hardware"

0
source

Source: https://habr.com/ru/post/1434002/


All Articles