- Building Android UIs with Custom Views
- Raimon Ràfols Montané
- 263字
- 2021-07-02 15:33:35
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.
- 極簡算法史:從數學到機器的故事
- Docker and Kubernetes for Java Developers
- Spring 5.0 By Example
- 自己動手實現Lua:虛擬機、編譯器和標準庫
- 跟老齊學Python:輕松入門
- Learning Laravel 4 Application Development
- Mastering LibGDX Game Development
- 名師講壇:Java微服務架構實戰(SpringBoot+SpringCloud+Docker+RabbitMQ)
- Learning Three.js:The JavaScript 3D Library for WebGL
- Python編程從0到1(視頻教學版)
- Mastering Unity 2D Game Development(Second Edition)
- RealSenseTM互動開發實戰
- Test-Driven Machine Learning
- OpenCV 3 Blueprints
- Visual Basic程序設計實驗指導及考試指南