Sign in Go Pro

Custom Views and ViewGroups

Setting Up a ViewGroup Subclass (Part 1)

12/01/2017

 

Up next

Previous

About

In this lesson, we'll start with the basics of extending the base `ViewGroup` class with an example of a custom list item: - How to create a composite or compound `ViewGroup` by extending the base `ViewGroup` and having specific children - How to extend the base `ViewGroup` class and which constructors to override when wanting to inflate a view from XML - Why to include references to child views as member variables - How `onFinishInflate` works and why we should initialize view references there - How to override the two main custom `ViewGroup` methods: `onMeasure` and `onLayout`.

Lessons in Custom Views and ViewGroups