- Mastering Android Studio 3
- Kyle Mew
- 123字
- 2021-07-02 18:42:36
Baseline alignment
Aligning text across multiple views using their baselines can be fiddly, especially when text is of different sizes. Fortunately, constraint layouts offer a simple and easy way to achieve this.
Any constrained view or widget designed to contain text, will contain a bar across its center. Hover over this for a moment, until it flashes, and then drag it to the view whose text you wish to align it with, as seen here:

Baseline alignment.
You will probably be familiar with the gravity attributes that the relative layout class uses to control positioning.
Baseline constraints can only be connected to other baselines.
The constraint layout introduces a new approach, allowing us to control the relative distances either side of the view.
推薦閱讀
- Visual C++程序設計學習筆記
- Mastering QGIS
- Learning SQLite for iOS
- 深入淺出Android Jetpack
- Apache Kafka Quick Start Guide
- INSTANT Sinatra Starter
- OpenCV 3 Blueprints
- Python 3 數據分析與機器學習實戰
- Oracle 12c從入門到精通(視頻教學超值版)
- OpenCV 3.0 Computer Vision with Java
- Flink入門與實戰
- Daniel Arbuckle's Mastering Python
- Learning Java Lambdas
- C#教程
- JavaWeb入門經典