2011-10-24 78 views
1

我正在嘗試創建一個看起來很花哨的標題。我正在使用應用了樣式的TTView,但是我的問題是我想要將投影放在圖像下方,而不是兩側。我希望雙方很難對着屏幕邊緣。Three20 TTStyle陰影

這裏是什麼樣子的時刻:

enter image description here

我怎樣才能使它所以雙方都硬起來反對屏幕的邊緣?

這裏是我的造型代碼:

UIColor* black = RGBCOLOR(158, 163, 172); 
UIColor* blue = RGBCOLOR(191, 197, 208); 
TTStyle *style = 
[TTShadowStyle styleWithColor:RGBACOLOR(0,0,0,0.5) blur:5 offset:CGSizeMake(0, 2) next: 
[TTLinearGradientFillStyle styleWithColor1:RGBCOLOR(255, 255, 255) 
            color2:RGBCOLOR(216, 221, 231) next: 
[TTFourBorderStyle styleWithTop:blue right:black bottom:black left:blue width:1 next:nil]]]; 

headerView.style = style; 

我很感激這個問題的任何幫助,因爲我從來沒有現在用three20。

回答

1

我想通了由最終的實驗 - 如果你在樣式鏈中的下拉陰影之前,雙方使用負UIEdgeMask,它推動主要看法到邊緣。

TTStyle *style = 
[TTInsetStyle styleWithInset:UIEdgeInsetsMake(0, -5, 0, -5) next: 
[TTShadowStyle styleWithColor:RGBACOLOR(0,0,0,0.5) blur:5 offset:CGSizeMake(0, 2) next: 
[TTLinearGradientFillStyle styleWithColor1:RGBCOLOR(255, 255, 255) 
            color2:RGBCOLOR(216, 221, 231) next: 
[TTFourBorderStyle styleWithBottom:black width:1 next:nil]]]]; 
0
self.btn1.layer.shadowOffset = CGSizeMake(10, 10); //set the the value for the shade size when the negative that goes to oposite side of current. 
    self.btn1.layer.shadowOpacity = 0.9; 
    self.btn1.layer.shouldRasterize = YES; 
    self.btn1.layer.shadowColor=[[UIColor grayColor]CGColor]; 

可能這個代碼是幫助你