2012-07-27 48 views
0

影子我有一個層,我需要的上半部分紅色陰影創建iphone

我的代碼是

Shadow.colors = [NSArray arrayWithObjects: 
           (id)[[[UIColor redColor] colorWithAlphaComponent:0.6] CGColor], 
           (id)[[UIColor clearColor] CGColor], 
           nil]; 
    Shadow.startPoint = CGPointMake(0,0.5); 
    Shadow.endPoint = CGPointMake(1,0.5); 

這給了我一個左半陰影。 我有什麼做的,有一個上半部分紅色陰影

+2

你嘗試扭轉你的CGPointMake裏面的數字嗎? – borrrden 2012-07-27 04:26:19

回答

0
Shadow.startPoint = CGPointMake(0.5,0); 
    Shadow.endPoint = CGPointMake(0.5,1); 

這解決了我的problem.Thanks borrrden