-[ display]: Ignoring bogus layer size

前端 未结 6 2302
天命终不由人
天命终不由人 2021-02-19 05:43
-[ display]: Ignoring bogus layer size (255211754908294243945860531626574872576.000000, 340282346638528859811704183484516925440.000000)
         


        
相关标签:
6条回答
  • 2021-02-19 06:31

    I believe this is caused because the layer is too large and I expect this will cause issues buffering to an image for drawing.

    I had this problem with a large UIView with relatively simple graphics and solved it by using a CATiledLayer

    To do this, include the following in your UIView subclass to enable tiling:

    + (Class)layerClass {
        return [CATiledLayer class];
    }
    
    0 讨论(0)
  • 2021-02-19 06:32

    I had this problem with a TableViewController embedded in a nav controller when segueing to detail VC. Changing from a show (push) to show (detail) fixed it. Make sure and clean.

    0 讨论(0)
  • 2021-02-19 06:32

    I had this problem when using -UIViewShowAlignmentRects YES as a startup variable. When I switched it off, the problem went away. Bug in Xcode?

    0 讨论(0)
  • 2021-02-19 06:38

    I had the same error while working with *UISegmentedControl and I was customizing a text using this method:

    [segmentedControl setTitleTextAttributes:(@{UITextAttributeFont: [UIFont regularFontWithSize:13.f],
                                                  UITextAttributeTextColor: controlsSelectedColor,
                                                  *UITextAttributeTextShadowOffset:* **@0**}) forState:UIControlStateNormal];
    

    The error also occurred only on the device and was because of incorrect attributedText parameter UITextAttributeTextShadowOffset I've set there an NSNumber, but according to documentation it should be UIOffset struct wrapped with NSValue. I've changed it to [NSValue valueWithUIOffset:UIOffsetZero] and it worked. The question is why it didn't work on the Simulator.

    So check your attributed text if You've used it. It could be such kind of magic.

    Hope this helped.

    0 讨论(0)
  • 2021-02-19 06:44

    I spent a bit of time trying to find the answer to a similar question, I was getting:

    [<CALayer: 0x37d540> display]: Ignoring bogus layer size (nan, nan)

    but only on a device, not on the simulator. My problem was due to the fact that I was loading images out of the applicationCacheDirectory and it turns out the files had a mix of upper and lower cases in my project director. But in the Cache directory on device, they were all changed to lower case. Hope this helps someone in the future.

    0 讨论(0)
  • 2021-02-19 06:45

    I just encountered this error in a view controller that was being presented in a popover. The "ignoring bogus layer size" error was occurring when the popover was presented, and as a result a text field within the view controller did not render its text.

    In my case, moving a textField.becomeFirstResponder() call from viewWillAppear to viewDidAppear resolved the issue.

    0 讨论(0)
提交回复
热议问题