【发布时间】:2011-09-24 00:51:11
【问题描述】:
我正在使用 Three20 库在我正在开发的 iPhone 应用程序中创建一个 TTLauncherView。当用户在启动器视图中触摸并按住其中一个项目时,它会导致所有项目开始摆动,并且“x”按钮出现在每个项目图像的左上角。此按钮用于从启动器视图中删除项目。我想将这个“x”按钮相对于项目图像稍微向下和向右移动。
我查看了 TTDeafaultStyleSheet 发现以下代码:
///////////////////////////////////////////////////////////////////////////////////////////////////
- (TTStyle*)launcherCloseButtonImage:(UIControlState)state {
return
[TTBoxStyle styleWithMargin:UIEdgeInsetsMake(-2, 0, 0, 0) next:
[TTImageStyle styleWithImageURL:nil defaultImage:nil contentMode:UIViewContentModeCenter
size:CGSizeMake(10,10) next:nil]];
}
///////////////////////////////////////////////////////////////////////////////////////////////////
- (TTStyle*)launcherCloseButton:(UIControlState)state {
return
[TTShapeStyle styleWithShape:[TTRoundedRectangleShape shapeWithRadius:TT_ROUNDED] next:
[TTInsetStyle styleWithInset:UIEdgeInsetsMake(1, 1, 1, 1) next:
[TTShadowStyle styleWithColor:RGBACOLOR(0,0,0,0.5) blur:2 offset:CGSizeMake(0, 3) next:
[TTSolidFillStyle styleWithColor:[UIColor blackColor] next:
[TTInsetStyle styleWithInset:UIEdgeInsetsMake(-1, -1, -1, -1) next:
[TTSolidBorderStyle styleWithColor:[UIColor whiteColor] width:2 next:
[TTPartStyle styleWithName:@"image" style:TTSTYLE(launcherCloseButtonImage:) next:
nil]]]]]]];
}
这段代码触摸了“x”按钮,但我无法弄清楚如何改变它的位置。有人有什么建议吗?
【问题讨论】:
标签: three20