هل زر حذف "X" في الجزء الشاشة الرئيسية من SDK؟
سؤال
لذلك عندما تريد حذف تطبيق من الشاشة الرئيسية ، أو حذف كتاب من iBooks ، عندما تدخل في "Modit Mode" ، يوجد القليل من bitty x في الزاوية اليسرى العليا من أيقونة التطبيق/الكتاب/أي شيء.
هل هذا الزر جزء من SDK؟
و ... إذا لم يكن الأمر كذلك (أنا متأكد من أنه ليس كذلك) ، هل يعرف أي شخص مشروع عينة Apple قد يحتوي على صورة X؟
المحلول
يمكنك محاولة البحث في springboard.app. (Springboard هي الشاشة الرئيسية في iOS.) يجب أن تكون موجودة في مكان ما مثل:
/developer/platforms/iphonesimulator.platform/developer/sdks/iphonesimulative*xyz*.sdk/system/library/coreservices/springboard.app/
تعديل: وفقًا للتعليق أدناه ، فإن موقع الصور لـ 4.1 Simulator SDK هو:
/developer/platforms/iphonesimulator.platform/developer/sdks/iphonesimulator4.1.sdk/system/library/coreservices/springboard.app/closebox.png/developer/platforms/iphonesimulator.platform/devenves/sdks/iphonesim4.1 /system/library/coreservices/springboard.app/closebox@2x.png
نصائح أخرى
إذا كنت مهتمًا برسم هذا باستخدام الكوارتز ، فسيتم سحب الكود التالي من 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 × 31 ، و strokeWidth
هو 2.0.
إذا كنت تريد استخدام هذه الصورة ، فقط:
- قصها من مكان ما
- اجعل الخلفية شفافة مع Photoshop
- أضف الصورة إلى Uibultton مخصص.
آسف لا أتذكر أي مشروع يستخدمه ...