IOS English Learning Translation official documentation--not updated regularly.

Source: Internet
Author: User
Tags uikit

1,

About the Text handling in IOS

The IOS platform gives you many ways to display text on your apps and let users edit that text. It also lets you display formatted the text and Web content in your app's views. The resources at your disposal range from theframework Objects-such as text views, text fields, and Web views-to text Layo UT engines that's can use directly to draw, lay out, and otherwise manage text.

With the classes in the UIKit framework, you can manage the Edit menu (including adding custom items to it), implement Cus Tom input views, and copy, cut, and paste data within and between apps.

Note:this document is previously titled Text, Web, and Editing Programming Guide for IOS.

At a Glance

Apps in IOS has a number of powerful technologies to handle text, both for editing text and for rendering high-quality Ty Pographically formatted text.

The UIKit Framework provides Your App with Text and Web Objects

Can add ready-made text views, text fields, and labels to your app's user interface by using instances of the  Uitextview ,   Uitextfield , and  UILabel . You can add and configure them programmatically or by using The interface Builder editor in Xcode. You can also turn a view of the your app into a miniature web browser capable of understanding and displaying HTML, CSS, and J Avascript content. You does this using a uiwebview  object.

Relevant chapters: "Displaying text Content in IOS," "typographical concepts," "Managing text fields and text views, " Displaying Web Content"

When Users Edit Text, Your App must Manage the Keyboard

When a user taps a text field, text view, or form field in a Web view, IOS animates a keyboard to view. An app can control which keyboard is presented; For example, for a Numeric-value field, the app should select the numeric keypad. If the entered or edited text is obscured by the keyboard, the app should adjust the view displaying the text so Text appears above the keyboard. the delegate of a text view, text field, or Web view is responsible for validating edited text and for accessing and S Toring edited text when the user dismisses the keyboard.

Relevant chapters: "Managing the Keyboard"

Your App Can Draw and Manage Text Directly

Underlying the text on UIKit is a powerful layout engine called text Kit. If you are need to customize the layout process or are need to intervene in the so behavior, you can use the Text Kit. Text Kit is a set of classes and protocols this provide high-quality typographical services which enable apps to store, LA Y out, and display text with all the characteristics of fine typesetting, such as kerning, ligatures, line breaking, and J Ustification.

For more apps, you can use the high-level text display classes and the text Kit for all their text handling. For smaller amounts of the text and special needs requiring custom solutions, you can use alternate, lower level technologies, such as the programmatic interfaces from the core Text, Core Graphics, and core Animation frameworks as well as other APIs s in UIKit itself.

To communicate directly with the text-input system of IOS, implement the UITextInput protocol and related protocols and Clas Ses. Your app can also make use of the technologies for spell checking and regular expressions.

Relevant Chapter: "Using text Kit to Draw and Manage Text," "Lower level text-handling Technologies"

Your App has a Range of Options for the Input and Editing of Data

The UIKit framework includes programmatic interfaces for editing the data in a view and for entering data into an app. Cus Tom input views can replace the system keyboard to permit input of special data; Input accessory Views is a custom view above the system keyboard (or custom input view) that enables users to affect edit Ed data in app-specific ways. Using and UIPasteboard related classes, an app can copy, cut, and paste data within different locations of itself or between Itse LF and another app. As part of Copy-cut-paste operations, the user taps a command in an contextual Edit menu; Your app manages this menu and can add custom commands to it.

Relevant chapters:: "Copy, Cut, and Paste Operations," "Displaying and managing the Edit Menu,""Custom views F or Data Input "

See Also

The core Graphics and core Animation frameworks have some text-handling capabilities. Core Animation, for example, offers the CATextLayer class. To learn on these capabilities, read Quartz 2D programming Guide (core Graphics) and core Animation P RogrammingGuide.

To find out more about the Core Text framework, which are appropriate for developing higher-level text-handling frameworks, Read core text Programming guide and Core text Reference Collection.

Next

IOS English Learning Translation official documentation--not updated regularly.

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.