2011-08-19 117 views
1
UIView *myView = self; 
    CALayer *layer = [myView layer]; 
    [layer setRasterizationScale:0.25]; 
    [layer setShouldRasterize:YES]; 

我發現這個代碼的地方除了問題是,當我用它它說沒有找到方法。另外,當我輸入圖層。並按下轉義查看自動完成的所有屬性我看不到所以是你能幫我找出問題,也許我沒有進口的東西?請提前幫助並提前致謝問題模糊UIImage

+0

固定只需要導入quartzcore – Aspyn

+0

如果你固定的,那麼把它作爲answer..and接受.. – Krishnabhadra

+0

我不得不等待7小時,因爲我沒有足夠的代表 – Aspyn

回答

3

您必須從現有框架導入Quartz核心框架並將其添加到您的項目中,然後導入到.h類中。

1

你好Aspyn,

 You will try this code this will help you 

     First of all add QuartzCore.framework from existing framework and .m file you import this framework as follow 
     #import <QuartzCore/QuartzCore.h> 
     UIView *myView = self; 
     CALayer *layer = [myView layer]; 
     [layer setRasterizationScale:0.25]; 
     [layer setShouldRasterize:YES]; 
     [layer setContentsScale:UIViewContentModeScaleAspectFit];