SORU
19 EYLÜL 2013, PERŞEMBE


İtiraz sizeWithFont için yedek: iOS 7?

İOS 7, sizeWithFont: artık önerilmiyor. Şimdi nasıl değiştirme yöntemi sizeWithAttributes: içine UİFont nesne geçtim mi?

CEVAP
19 EYLÜL 2013, PERŞEMBE


Şimdi NSDictionary alır sizeWithAttributes: yerine kullanın. UITextAttributeFont ve bu gibi yazı tipi nesne ile anahtar çifti geçer

CGSize size = [string sizeWithAttributes:
    @{NSFontAttributeName: [UIFont systemFontOfSize:17.0f]}];

// Values are fractional -- you should take the ceilf to get equivalent values
CGSize adjustedSize = CGSizeMake(ceilf(size.width), ceilf(size.height));

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Caina Mondo Zine

    Caina Mondo

    13 EKİM 2007
  • How It Should Have Ended

    How It Shoul

    5 Mart 2007
  • kylelandry

    kylelandry

    9 AĞUSTOS 2007