-[ display]: Ignoring bogus layer size

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


        
6条回答
  •  傲寒
    傲寒 (楼主)
    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.

提交回复
热议问题