Sign in Go Pro

Custom Views and ViewGroups

Setting Up a ViewGroup Subclass (Part 1)

 

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.

Comments

There are no comments on this lesson, start the conversation below ...

>
You need to go PRO to post comments.

Lessons in Custom Views and ViewGroups