官术网_书友最值得收藏!

What's a custom view

As we have just mentioned, a custom view is a view where we've implemented its behavior ourselves. That was an oversimplification, but it was a good way to start. We don't really have to implement its complete behavior ourselves. Sometimes, it can just be a simple detail, or a more complex feature or even the whole functionality and behavior such as interaction, drawing, resizing, and so on. For example, tweaking the background color of a button as a custom view implementation, it's a simple change, but creating a bitmap-based menu that rotates in 3D is a complete different story in development time and complexity. We'll show how to build both of them in this book but, in this chapter, we'll only focus on the very simple example and we'll add more features in the chapters to come.

Throughout the book, we'll be referring both to custom view and to custom layouts. The same definition of custom view can also be applied to layouts, but with the main difference that a custom layout will help us to lay out the items it contains with the logic we create and position them the precise way we would like. Stay tuned, as later on we'll learn how to do so as well!

The layouts are usually known as ViewGroup. The most typical examples and those you probably have heard of and most probably in your applications are: LinearLayout, RelativeLayout, and ConstraintLayout.

To get more information about Android views and Android layouts, we can always refer to the official Android developer documentation:
https://developer.android.com/develop/index.html.

主站蜘蛛池模板: 宁陵县| 常德市| 阿勒泰市| 韶关市| 东丰县| 寻甸| 鹰潭市| 深泽县| 临澧县| 莫力| 平塘县| 阳高县| 建德市| 洛扎县| 涞水县| 湘潭市| 盈江县| 永宁县| 福海县| 新营市| 井陉县| 开阳县| 稻城县| 花莲县| 渭南市| 普宁市| 黄山市| 平南县| 青浦区| 五河县| 义乌市| 布尔津县| 麦盖提县| 五指山市| 汤原县| 营口市| 惠水县| 四子王旗| 清河县| 涟源市| 海林市|