June 2013
Intermediate to advanced
216 pages
6h 3m
English
In this chapter, we’ll cover tips and recommendations for Android layouts. You’ll learn how to create certain types of layouts from scratch as well as how to improve upon existing ones.
At an Android talk I gave to a group of developers, when I was explaining how to create a view using an XML file, someone asked, “What should I write if I want a button to be centered and 50% of its parent width?” At first I didn’t understand what he was asking, but after he drew it on the board, I understood. His idea is shown in figures 1.1 and 1.2.