`
dcj3sjt126com
  • 浏览: 1874099 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

IOS 为整个APP设置一个字体,但是不指定字体大小 How to set a custom font for entire iOS app without s

    博客分类:
  • IOS
阅读更多
- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setFontFamily:@"FagoOfficeSans-Regular" forView:self.view andSubViews:YES];
}

-(void)setFontFamily:(NSString*)fontFamily forView:(UIView*)view andSubViews:(BOOL)isSubViews
{
    if ([view isKindOfClass:[UILabel class]])
    {
        UILabel *lbl = (UILabel *)view;
        [lbl setFont:[UIFont fontWithName:fontFamily size:[[lbl font] pointSize]]];
    }

    if (isSubViews)
    {
        for (UIView *sview in view.subviews)
        {
            [self setFontFamily:fontFamily forView:sview andSubViews:YES];
        }
    }    
}
 
分享到:
评论

相关推荐

    iOS 9 SDK Development: Creating iPhone and iPad Apps with Swift

    After thoroughly exercising the language's features, you'll dig into the capabilities of the iOS frameworks by building a real-world app, from a simple button to a multi-screen client that cleanly ...

    How to be a Programmer

    How to be a Programmer: Community Version Robert L. Read with Community Copyright 2002, 2003, 2016 Robert L. Read Licensed under Creative Commons Attribution-ShareAlike 4.0 International License. ...

    iOS Apprentice 4 StoreSearch v4.1

    The StoreSearch app One of the most common things that mobile apps do...Apple has made a web service available for searching the entire iTunes store and you’ll be using that to learn about networking.

    Learning iOS UI Development

    Through this comprehensive one-stop guide, you'll get to grips with the entire UIKit framework and in a flash, you'll be creating modern user interfaces for your iOS devices using Swift. Starting ...

    Gradle for Android

    Using Gradle makes it easy for Android developers to manage dependencies and set up the entire build process., This book begins by taking you through the basics of Gradle and how it works with ...

    Learning iOS UI Development pdf 无水印 0分

    Starting with an overview of the iOS drawing system and the available tools, you will then learn how to use these technologies to create adaptable layouts and custom elements for your applications....

    Xcode.7.Essentials.2nd.Editio

    This guide to will get you up and running with the entire workflow to develop Apple apps without previous Xcode experience Packed with plenty of tips on how to use Xcode with Swift 2 and other ...

    iPhone App Development: The Missing Manual

    But if you want to build a great app, there’s a lot more to it than simple coding: you also need to know how design and market your creation. This easy-to-follow guide walks you through the entire ...

    UE(官方下载)

    How to set the highly-configurable options for UltraEdit's integrated spell checker Special functions UltraEdit includes several special functions under the File menu. You can use these functions to ...

    Xcode 7 Essentials(PACKT,2ed,2016)

    This guide to will get you up and running with the entire workflow to develop Apple apps without previous Xcode experience * Packed with plenty of tips on how to use Xcode with Swift 2 and other ...

    iOS-2048-master

    It may not be a terribly good idea to change the font, add some ads, and submit to Apple, though. #### Contributors * Danqing Liu (me) * [Scott Matthewman](https://github.com/scottmatthewman) * ...

    The Executive’s How-To Guide to Automation

    The Executive’s How-To Guide to Automation: Mastering AI and Algorithm-Driven Business By 作者: George E. Danner ISBN-10 书号: 3319997882 ISBN-13 书号: 9783319997889 Edition 版本: 1st ed. 2019 出版...

    Learn.Mobile.Game.Development.in.One.Day.Using.Gamesalad

    The book is meant to be used as a learning tool, it’s filled with over 35 hands-on exercises and four chapters dedicated to learning how to make four different game types. Once you have completed the...

Global site tag (gtag.js) - Google Analytics