New features of IOS11--preferslargetitles properties

Source: Internet
Author: User

As a novice in iOS development, unfortunately, luckily, I caught up with iOS 11. Unfortunately, the previous version of the properties are not skilled, mostly not familiar with, and issued a new version, and the relevant properties, for the big boys, think very simple, very normal things, only to mention a sentence, and some even did not mention, leading us these just contact with iOS newcomers, really do not know where to start. Fortunately, the new features and save a lot of code, and some of the functions of a few lines, making me this novice always think my code is wrong, is not reliable.

The first new feature I contacted was the Preferslargetitles attribute, which is bool.

Self. Navigationcontroller. Navigationbar. Preferslargetitles = YES;//This sentence indicates whether to display a large title

Self. Navigationitem. Title = @ "Settings";//Set caption

Self. Navigationitem. Largetitledisplaymode = uinavigationitemlargetitledisplaymodeautomatic;//This is the way the title is displayed, which will be described in detail below

When Preferslargetitles is set to Yes, a large caption is displayed, as shown in:

No big headlines when no is displayed


And Largetitledisplaymode is in conjunction with the Preferslargetitles property, as long as the preferslargetitles is yes when the effective, Largetitledisplaymode has three modes:

Uinavigationitemlargetitledisplaymodenever is always showing a small title

Uinavigationitemlargetitledisplaymodealways: Always show big headlines

Uinavigationitemlargetitledisplaymodeautomatic: Automatically displays a large title or a small title. In my words: The initial is a big headline, and when you swipe to make a big title hide it displays a small caption.

and change the big title color, is to use largetitletextattributes this attribute (before turning a lot of posts, not that can not be changed to mean with setlargetitletextattributes this attribute, do not say how to use, Hey, Feel compelled to die small white). Here are the properties that I set for the big title.

[self. Navigationcontroller. Navigationbar setlargetitletextattributes: [Nsdictionary dictionarywithobjectsandkeys: [Uicolor whitecolor], nsforegroundcolorattributename, [ Uifont systemfontofsize:18.0f],nsfontattributename,Nil]];

The first time I wrote this kind of thing, I felt a little confused about what I read.

Article reference: HTTP://WWW.JIANSHU.COM/P/D4A17C32ABDF

New features of IOS11--preferslargetitles properties

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.