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

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.

主站蜘蛛池模板: 同心县| 阜城县| 嘉祥县| 屏东县| 益阳市| 云浮市| 新竹县| 通辽市| 莒南县| 拉孜县| 娄底市| 甘泉县| 迭部县| 南涧| 黔东| 广元市| 仁布县| 冷水江市| 新宁县| 慈利县| 武汉市| 乐平市| 龙里县| 鄂温| 丘北县| 德庆县| 罗源县| 贡山| 资源县| 海门市| 普兰店市| 湄潭县| 明溪县| 曲麻莱县| 荣昌县| 辽阳市| 渭南市| 东乡县| 英超| 马尔康县| 抚顺市|