Three20 TTStyle 阴影
我正在尝试为视图创建一个看起来很漂亮的标题。我正在使用应用了样式的 TTView,但我的问题是我希望阴影仅落在图像下方,而不是侧面。我希望侧面紧贴屏幕边缘。
这是目前的样子:
我怎样才能使它的侧面难以对抗屏幕边缘?
这是我的样式代码:
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。
I'm trying to create a fancy-looking header to a view. I'm using a TTView with styling applied, but my problem is I want the drop shadow to just drop below the image, and not to the sides. I want the sides hard up against the screen edges.
Here is what it looks like at the moment:
How can I make it so the sides are hard up against the edge of the screen?
Here is my code for the styling:
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;
I would appreciate any help with this issue as I've never used three20 before now.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我最终通过实验发现了这一点 - 如果您在样式链中的投影之前的侧面使用负 UIEdgeMask,它将把主视图推到边缘。
I figured it out by experimentation in the end - if you use a negative UIEdgeMask on the sides before the drop-shadow in the style chain, it pushes the main view out to the edges.
愿这段代码对您有帮助
May this code is helping to you