`
shuai1234
  • 浏览: 935409 次
  • 性别: Icon_minigender_1
  • 来自: 山西
社区版块
存档分类
最新评论

CGAffineTransformInvert: singular matrix. 解决方案

 
阅读更多
 

CGAffineTransformInvert: singular matrix. 解决方案

分类: Xcode 编程 Objective -c 435人阅读 评论(0) 收藏 举报

这个错误叫奇异矩阵,

引起的原因有三种:

1  [UIFont fontWithName:@"AFontName" size:0]      你把字体的size设置为0了

2 你添加的view控件frame为0 例如:

I was seeing this problem too when I added a UIWebView to my self.view.
The offending code was:

UIWebView *wv = [[UIWebView alloc]init];
and the solution is:

UIWebView *wv = [[UIWebView alloc]initwithFrame:[[UIScreen mainScreen]bounds]];
or any framesize except 0.0.

3. UIScrollView, storyboard , autolayout 冲突,这个好像是苹果的问题,解决方法是
uncheck the "use autolayout" checkbox on storyboard properties

4.  如果你用webview 载入网页出现这样问题的话,是因为
CSS 設定 display: inline-block 而造成 Transform 错误(估计是苹果的bug)


解決方法是:
選擇一:不要用「display: inline-block」(這應該會是 Apple 會回答你的解決方案)。
選擇一:如果你跟我一樣,使用「display: inline-block」是為了要把 Element 排成橫的,那麼恭喜!你可以改用「display: table-cell」,效果一樣!

 

 

参考: 


http://stackoverflow.com/questions/7471027/overriding-layoutsubviews-causes-cgaffinetransforminvert-singular-matrix-ran
http://firchtsai.blogspot.com/2013/02/ios-cgaffinetransforminvert-singular.html

http://stackoverflow.com/questions/7471027/overriding-layoutsubviews-causes-cgaffinetransforminvert-singular-matrix-ran

 

I was seeing this problem too when I added a UIWebView to my self.view.

The offending code was:

UIWebView*wv =[[UIWebView alloc]init];

and the solution is:

UIWebView*wv =[[UIWebView alloc]initwithFrame:[[UIScreen mainScreen]bounds]];

or any framesize except 0.0.

 

更多0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics