Dotted line is actually not dotted when app is running on real Android device

后端 未结 3 1895
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-15 16:40

in my app I use XML defined vertical dotted line.




        
3条回答
  •  鱼传尺愫
    2020-12-15 16:48

    Controlling Hardware Acceleration

    You can control hardware acceleration at the following levels:

    • Application

    • Activity

    • Window

    • View

    Application level

    
    

    Activity level

    
        
        
    
    

    Window level

    getWindow().setFlags(
        WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
        WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
    

    View level

    myView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
    

    Reference

提交回复
热议问题