0
文字我申请属性我的文字像这样:应用属性中的iOS
//Great the number string and the rect to put it in
NSString *numberOne = @"1";
CGRect numberRect = CGRectMake(47, 100, 50, 50);
//Create the attributes
UIFont *font = [UIFont fontWithName:@"Academy Engraved LET" size:60];
NSParagraphStyle *paragraphStyle = [NSParagraphStyle defaultParagraphStyle];
NSDictionary *numberOneAttributes = @{NSParagraphStyleAttributeName: paragraphStyle, NSFontAttributeName: font, NSForegroundColorAttributeName: [self darkGoldColor]};
[numberOne drawInRect:numberRect withAttributes:numberOneAttributes];
我不明白数组的初始化。为什么我们使用NSParagraphStyleAttributeName: paragraphStyle
,不应该把第一项作为关键?这本词典里的钥匙在哪里?任何指针都会很棒。谢谢
http://clang.llvm.org/docs/ObjectiveCLiterals.html – Larme