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

  • geraldnonadoez

    geraldnonado

    3 Temmuz 2013
  • hydejiaqi

    hydejiaqi

    12 Mart 2008
  • krotoflik

    krotoflik

    26 ŞUBAT 2011