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

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.

主站蜘蛛池模板: 疏勒县| 应城市| 三亚市| 盖州市| 和田市| 个旧市| 渝中区| 龙门县| 泌阳县| 察雅县| 利辛县| 繁峙县| 水城县| 宿松县| 应用必备| 彭州市| 兴业县| 墨脱县| 博野县| 嘉鱼县| 科尔| 上虞市| 会东县| 肇州县| 于田县| 正定县| 南开区| 临西县| 溧阳市| 太湖县| 鄂伦春自治旗| 离岛区| 盈江县| 岚皋县| 渝北区| 黄山市| 长海县| 乌兰察布市| 鲁山县| 新宁县| 宿州市|