Take a look at Layout Classes and Basic Layouts Example.