

Change the ConstraintLayout from ViewGroup to RelativeLayout.How to style the TextView background color and text color.How to display free-form text with some HTML formatting tags.


A good choice for a View within a ScrollView is a LinearLayout that is arranged in a vertical orientation, presenting items that the user can scroll through (such as TextView elements).

This child view may itself be a ViewGroup (such as LinearLayout) containing UI elements.Ĭomplex layouts may suffer performance issues with child views such as images. Place only one view as a child within it - a child view contains the entire contents to scroll. The ScrollView class provides the layout for the scrolling view. You can also use a scrolling view to enable users to enter multiple lines of text, or to combine UI elements (such as a text field and a button) within a scrolling view. You would typically use a scrolling view for news stories, articles, or any lengthy text that doesn't completely fit on the display. If you have more information than fits on the device's display, you can create a scrolling view so that the user can scroll vertically by swiping up or down, or horizontally by swiping right or left. This practical shows how to work with multiple TextView elements, including one in which the user can scroll its contents vertically. You can control how the text appears with TextView attributes in the XML layout file. The TextView class is a subclass of the View class that displays text on the screen. Note: This course uses the terms "codelab" and "practical" interchangeably. For details about the course, including links to all the concept chapters, apps, and slides, see Android Developer Fundamentals (Version 2).These codelabs are an updated version of Codelabs for Android Developer Fundamentals (V2).You will get the most value out of this course if you work through the codelabs in sequence: This practical codelab is part of Unit 1: Get started in CS3040/DC3040.
