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

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.

主站蜘蛛池模板: 克拉玛依市| 苗栗市| 新沂市| 东莞市| 公主岭市| 嘉荫县| 板桥市| 无为县| 阿勒泰市| 鸡西市| 崇州市| 辽源市| 六枝特区| 原平市| 东源县| 陆良县| 大石桥市| 昭通市| 成安县| 亳州市| 新干县| 彝良县| 临洮县| 北川| 邛崃市| 德州市| 会宁县| 五峰| 界首市| 色达县| 红原县| 北海市| 镇远县| 乌兰县| 钟山县| 溆浦县| 高淳县| 连南| 通城县| 托克逊县| 格尔木市|