-
Notifications
You must be signed in to change notification settings - Fork 472
Common Views
These are the most common views used on iOS.
Labels display text. It defaults to a single line, but if you set the line count to 0, it will use multiple lines.
Image Vies display images. By default, user-interaction is disabled. If you attach gestures to the view, and nothing happens, remember to re-enable it.
You can assign buttons to trigger code on tap, to "touch up inside" event. You could also trigger code on other events, like when the user first presses down, but hasn't lifted their finger.
Text fields are for single lines of text input, like a form field. They're similar to an HTML input
tag of type text
.
UITextView is for long blocks of (possibly editable) text.
Unlike a webpage, if your view is too large to fit on screen, it won't automatically become scrollable. If you want to make a large view scrollable, place it inside a scrollview.
Table views display long lists of items. It one of the most common root views on iOS. These are covered in greater detail in Table View Basics.