Application freezes when trying to present rear camera on iPad

前端 未结 4 1723
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-02 19:46

The application that i am working on runs on both iPhone & iPad . One of the functionality that the application has, is to capture image from camera. I am using UIImageP

4条回答
  •  忘掉有多难
    2021-01-02 20:28

    Finally I solved the problem,

    I implement a Theme approach for all application. In my AppDelegate file i set user interface settings while the application is being initialize.

    Here is the issue,

    There is a UISlider in camera UI, this slider view is always visible in iPad rear camera but in iPhones it is only visible when your are using zoom.

        UISlider.appearance().minimumTrackTintColor = themeUI.PrimaryColor.withAlphaComponent(100)
        UISlider.appearance().thumbTintColor = themeUI.PrimaryColor
    

    These two lines changes appearance for all the sliders in the application, which means it also changes the UI for camera slider.

    As you can see at the screen shot that i granted, while drawing camera CoreGraphics library calls

        [UISlider setMinimumTrackTintColor];
    

    Somehow setting minimumTrackTintColor for slider is causing invalid context error.

    Additionally setting thumTintColor works fine, it is also changing the thumb color for UISlider in Camera :)

    Maybe this issue is related with Swift 3, I will report a bug and we will see :)

提交回复
热议问题