O'Reilly logo

Android UI Fundamentals: Develop and Design by Jason Ostrander

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

10. Creating Custom Views

The Android view framework provides a rich visual toolkit with which to create your application UI. However, you may find that the functionality you need is not available in the stock views. For those cases, Android allows you to create a custom view that will better match your needs. In this chapter, you will learn that Android draws views in two passes, a measure phase and a layout phase; that you should override the onMeasure and onDraw methods when creating a custom view; that using custom view attributes requires that you declare a new XML namespace for those attributes; and that compound views combine multiple views into a custom component.

Understanding How Android Draws Views

Before learning how to create custom ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required