Is the delete button “X” on the main part of the SDK screen?

So, when you want to remove an application from the main screen or delete a book from iBooks, when you get into the “Edit Mode”, in the upper left corner of the application icon / no difference.

Is this button part of the SDK?

And ... if not (I'm sure it’s not), does anyone know an Apple prototype project that might contain an X-image?

+3
source share
3 answers

You can try looking at Springboard.app. (Springboard is the main screen in iOS.) It should be located somewhere like:

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator*X.Y.Z*.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

+5

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.

+2

, :

  • -
  • Make background transparent with photoshop
  • Add an image to your custom UIButton.

Sorry, I don’t remember a single project that uses it ...

0
source

Source: https://habr.com/ru/post/1768136/


All Articles