IOS 8 by Tutorials (1.4 adaptive fonts)

Source: Internet
Author: User

1.4. Adaptive Font

The 定制 size classes current text size is displayed well on the ipad, but it's 紧凑 size classes still too big. Don't worry--by size classes still being able to overwrite (compatible) text size.

Note: Unlike layout overrides, changing the font configuration will affect the underlying layout, changing the font configuration in IB will not adhere to the current size classes, instead, use the following method

Re- Any Width | Any Height Select Size Class , the following bar will be dimmed immediately-this is because you are back in the basic layout.

Select Cupertino label , open Attributes Inspector , click on Font the left + :

A new font size class combination appears, selecting Compact Width > Any Height :

This creates a second font selection box to apply to the special size class combination, setting the new Font selection box to 90 :

Now use the same process to set label the temperature, set Compact Width > Any Height the font size to 150 .

The interface immediately played a role, and it turned out to be: Twitter

Very good! It looks a little better, but Cupertino it omits a part and corrects the font size until it is not particularly stretched. Cupertinois a very long place name, but longer Washington, D.C. , there Kleinfeltersville, PA will be longer, how should we design AH!!

Once again, auto-layout has come to rescue you! You just need to limit the width of the two label to match in TextContainer the width just fine, Ctrl-drag``Cupertino TextContainer and then select Equal Widths . Repeat the same steps to set the temperature label :

Well, these incomplete text is not what you want, this is the label default property--The available space does not show the extra text. However it also has other options to solve this problem-in the available space to change the font from adaptation.

Select Cupertino Open Attributes Inspector , modify AutoShrink to Minimum font scale and set the value to 0.5 , and Text Alignment change to Centered , as shown:

Repeat the same steps to set the temperature label .

Take a look at the preview pane, which looks much better on the iphone's layout:

It would be better to run in the preview editor, but this could be a good way to build and run your project on everything that's still working, and look great on the iphone screen:

However, the ipad looks cloud image ridiculously small, especially on the vertical screen:

This is because you are using the same images shown on the ipad and iphone. In the next section you'll learn to improve the size of your pictures on the ipad.

IOS 8 by Tutorials (1.4 adaptive fonts)

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.