In the previous section, we learned about bars, which play a pivotal role in creating the application view, primarily in the header and footer section of the screen. In this section, we will learn about other user interface elements essential for creating an interactive view. We will not discuss all the UI elements, however, as there are too many of them; we will examine only those that are used most frequently.
A label displays a read-only text view and is used to display information. With the iOS SDK, we make use of the UILabel
class to generate labels on screen. The UILabel
class has many properties for customizing a label. In the following example, we will use a few of these properties to make our own customized label:
First, update the
tab1_controller.rb
file with following code inside theapp
folder:def viewDidLoad view.backgroundColor = UIColor.scrollViewTexturedBackgroundColor setupNavigationBar add_form_elements end
Next, add the
add_form_elements...