Now let's take a look at the text view. A text view displays multi line style text content. By default, content within a text view is left align and uses the system font in black. A text view is actually a rectangle of any height. It supports scrolling when the content is too large to fit inside its bounds. It also supports custom fonts, colors, and alignments.
By default, a text you display is left aligned system font in black, as we mentioned before, it can support editing, in which case a keyboard appears when the user taps inside the TextView. The keyboard input method and layout are determined by the user's language settings and also by the settings that you set in your app. You should of course, always make sure the text is easy to read, although you can use attributed settings to come by multiple fonts, colors, and alignments in creative ways, it's essential to maintain the readability of the text. Of course, let's touch the topic of the keyboard options. You should specify different keyboard types to accommodate different types of content you expect users to enter. For example, you might want to make it easy for users to enter a URL, a pin, or a phone number.
IOS provides several keyboard types, each designed to facilitate a different type of input. You can also specify if it should be a light or dark keyboard, it defaults to a light one. Now let's go over all the available keyboard types. The first one is the default type. With the default type, a standard keyboard would appear. Not that it can be in different language depending on user settings.
To invoke precisely a standard English keyboard, use the UI keyboard type Ci capable in the code. The next type is numbers and punctuation keyboard and well is perfect for entering numbers and different punctuation signs. You know how often we switch the keyboard layout to this mode. So if it makes sense in your case, you can invoke this keyboard right away. The next type is a URL keyboard. These keyboard type prominently features the period and slash characters and the.com string to make it easy to enter.
You guessed it, the URLs. Next, we have a number pad keyboard type. Use this keyboard for pin entries. For example. As you can see, this keyboard type prominently features the numbers of zero through nine. This keyboard does not support the capitalization because you don't need to capitalize numbers use the phone pad keyboard pointer in telephone numbers.
Besides featuring the numbers, it has the plus Asterix and the pound symbol. Note how it works. You switch the views to enter these additional signs. This keyboard type also does not support the capitalization. Yeah, thanks to Apple I guess we don't need to capitalize the phone numbers, you know. The name phone pad keyboard type is for entering a name or phone number.
You can switch easily between the keypad and an alphabet. This keyboard tab does not support our capitalization either. Then, we have the email address type of keyword. It prominently displays the Add sign, period and space. There is the keyboard type for entering numbers called decimal pad. In addition to numbers, it has the decimal point okay Imagine there's even a special type of keyboard for tweeting.
It has the Add sign and the hashtag sign president. The web search keyboard type prominently features the space and period characters. Not that the emoji type of keyboard is not specified in the documentation as a keyboard type that you could invoke in your app. You cannot invoke this keyboard right away. You can also specify a special title for the return key on the keyboard. Here are the ones you can have.
Go Google john next route search sent Yahoo. Dan, emergency call continue. you're limited to this choice. It's not possible to have your own custom title. Let's go over the keyboard attributes that can be tweaked. For starters, the capitalization you can control how they enter text is capitalized.
For example, you might want to enable the title stuff deliberation when each word is capitalized. You can enable or disable the auto correction. You can enable or disable the spell checking. This is when the word gets underlined and corrections are suggested. Upon tapping on that word. It is also possible to create your own completely custom looking keyboards.
Think twice before doing though, you will break users expectations and low the developers so make sure it will really provide enough benefits. We discussed the custom keyboards in more detail in the custom keyboards lecture.