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

  • Animation Workshop

    Animation Wo

    8 NİSAN 2010
  • Diogo Oliveira

    Diogo Olivei

    4 HAZİRAN 2006
  • Erica Griffin

    Erica Griffi

    8 HAZİRAN 2009