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

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.

主站蜘蛛池模板: 长兴县| 乌拉特后旗| 日喀则市| 洮南市| 宜昌市| 岐山县| 平江县| 马龙县| 瑞昌市| 丹阳市| 格尔木市| 唐海县| 宁远县| 邓州市| 大田县| 全州县| 德化县| 云浮市| 孟津县| 鲁山县| 沅陵县| 革吉县| 八宿县| 保山市| 吉首市| 扬州市| 西宁市| 安龙县| 公主岭市| 门头沟区| 莆田市| 明水县| 平乡县| 沙河市| 突泉县| 九龙城区| 云梦县| 罗田县| 恩平市| 平度市| 龙南县|