7

My app's main screen is rendered via SKCanvasView. The colors accurately reflect the values I specified in code.

If I swap-in SKGLView (hardware-accelerated version), changing no other code, the result is 60% darker:

    <!--<skia:SKCanvasView PaintSurface="OnCanvasViewPaintSurface" />-->
    <skia:SKGLView PaintSurface="OnCanvasViewPaintSurface" />

Why is this happening and how do I fix it?

4

1 回答 1

2

答案可以在这里找到:https ://github.com/mono/SkiaSharp/issues/299#issuecomment-331990904

我找到了问题的解决方案。在初始屏幕样式中设置了一个特定属性,但在样式更改时并未取消设置(出于某种原因)。

splashscreen样式中,请注意:

<item name="android:backgroundDimEnabled">true</item>

文档:https ://developer.xamarin.com/api/field/Android.Resource+Attribute.BackgroundDimEnabled

切换样式时不会取消设置。因此,要解决此问题,只需将其设置为 false:

<item name="android:backgroundDimEnabled">false</item>

这是一个展示这一点的存储库: https ://github.com/mattleibow/AndroidGLSurfaceViewTests

于 2017-09-28T14:09:45.510 回答