因此,当您想要从主屏幕上删除应用程序或从iBooks中删除图书时,当您进入“编辑模式”时,应用程序图标/书籍/应用程序的左上角会有一些小小的X,随你。SDK的主屏幕部分是否为“X”删除按钮?
此按钮是SDK的一部分吗?
如果没有(我敢肯定它不是),有人知道可能包含X图像的Apple示例项目吗?
因此,当您想要从主屏幕上删除应用程序或从iBooks中删除图书时,当您进入“编辑模式”时,应用程序图标/书籍/应用程序的左上角会有一些小小的X,随你。SDK的主屏幕部分是否为“X”删除按钮?
此按钮是SDK的一部分吗?
如果没有(我敢肯定它不是),有人知道可能包含X图像的Apple示例项目吗?
你可以尝试寻找在Springboard.app。 (Springboard是iOS中的主屏幕。)它应该位于以下位置:
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator*XYZ*.sdk/System/Library/CoreServices/SpringBoard.app/
编辑:每下面的评论,对于4.1模拟器SDK中的图像的位置是:
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System /Library/CoreServices/SpringBoard.app/closebox.png /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/CoreServices/SpringBoard.app/closebox \ @ 2x.png
如果您想使用这张图片,只是:
对不起,我不记得使用它的任何项目...
如果你有兴趣在此画使用Quartz,下面的代码是从我创建呈现这种删除按钮的CALayer的拉升:
#define SPACETOEXPANDDELETELAYERFORSHADOW 4.0f
#define FRACTIONOFVIEWFORSTARTANDSTOPOFCROSSLINES 0.38
- (void)renderAsVectorInContext:(CGContextRef)context;
{
if (strokeColor == NULL)
return;
CGContextSetLineJoin(context, kCGLineJoinBevel);
CGContextSetStrokeColorWithColor(context, strokeColor);
CGContextSetLineWidth(context, strokeWidth);
CGContextSetLineCap(context, kCGLineCapRound);
CGRect currentFrame = self.bounds;
currentFrame = CGRectInset(currentFrame, SPACETOEXPANDDELETELAYERFORSHADOW, SPACETOEXPANDDELETELAYERFORSHADOW);
CGContextSetShadow(context, CGSizeMake(2.0f, 2.0f), 2.0f);
CGContextFillEllipseInRect(context, CGRectMake(currentFrame.origin.x + strokeWidth, currentFrame.origin.y + strokeWidth, currentFrame.size.width - (2.0f * strokeWidth), currentFrame.size.height - (2.0f * strokeWidth)));
CGContextStrokeEllipseInRect(context, CGRectMake(currentFrame.origin.x + strokeWidth, currentFrame.origin.y + strokeWidth, currentFrame.size.width - (2.0f * strokeWidth), currentFrame.size.height - (2.0f * strokeWidth)));
CGContextSetLineWidth(context, 1.3f * strokeWidth);
CGContextBeginPath(context);
CGContextMoveToPoint(context, currentFrame.origin.x + FRACTIONOFVIEWFORSTARTANDSTOPOFCROSSLINES * currentFrame.size.width, currentFrame.origin.y + FRACTIONOFVIEWFORSTARTANDSTOPOFCROSSLINES * currentFrame.size.height);
CGContextAddLineToPoint(context, currentFrame.origin.x + (1.0f - FRACTIONOFVIEWFORSTARTANDSTOPOFCROSSLINES) * currentFrame.size.width, currentFrame.origin.y + (1.0f - FRACTIONOFVIEWFORSTARTANDSTOPOFCROSSLINES) * currentFrame.size.height);
CGContextMoveToPoint(context, currentFrame.origin.x + (1.0f - FRACTIONOFVIEWFORSTARTANDSTOPOFCROSSLINES) * currentFrame.size.width, currentFrame.origin.y + FRACTIONOFVIEWFORSTARTANDSTOPOFCROSSLINES * currentFrame.size.height);
CGContextAddLineToPoint(context, currentFrame.origin.x + FRACTIONOFVIEWFORSTARTANDSTOPOFCROSSLINES * currentFrame.size.width, currentFrame.origin.y + (1.0f - FRACTIONOFVIEWFORSTARTANDSTOPOFCROSSLINES) * currentFrame.size.height);
CGContextStrokePath(context);
}
在这种情况下
, strokeColor
是一个白色CGColorRef,图层是31 x 31,并且strokeWidth
是2.0。
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/CoreServices/SpringBoard.app/closebox.png /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/ iPhoneSimulator4.1.sdk/System/Library/CoreServices/SpringBoard.app/closebox \ @ 2x.png – vikingosegundo 2010-10-06 00:10:52
苹果在SDK中没有使这些无处不在的图标更容易访问,标准图标在Android中可用 – 2012-05-14 15:47:05