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

  • njhaley

    njhaley

    24 NİSAN 2006
  • sk8ingis4me

    sk8ingis4me

    16 Mart 2006
  • Tutorials Junction

    Tutorials Ju

    1 Ocak 2014