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

  • 07cadikiz07

    07cadikiz07

    17 EKİM 2007
  • Awesomesauce Network

    Awesomesauce

    4 EKİM 2012
  • Phlearn Photoshop and Photography Tutorials

    Phlearn Phot

    11 EKİM 2011