Skip to content

Instantly share code, notes, and snippets.

@brucetoo
Created September 14, 2015 12:02
Show Gist options
  • Select an option

  • Save brucetoo/cf9aa6b6a5d1b8a5d1d4 to your computer and use it in GitHub Desktop.

Select an option

Save brucetoo/cf9aa6b6a5d1b8a5d1d4 to your computer and use it in GitHub Desktop.
硬件加速
硬件加速分四个等级
Application Level:<application android:hardwareAccelerated="true" ...>
Activity Level:<application android:hardwareAccelerated="true">
<activity ... />
<activity android:hardwareAccelerated="false" />
</application>
即使在Application层开启了硬件加速,也可以对单个的Activity选择是否开启硬件加速
Window Level: getWindow().setFlags(
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
View Level: myView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment