Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

First Baseline and Last Baseline Properties in UIStackView

What effect do the First Baseline and Last Baseline properties have on the subviews of a UIStackView?

Generally, can someone please illustrate the implementation of these values?

like image 473
Burhanuddin Sunelwala Avatar asked Nov 26 '15 07:11

Burhanuddin Sunelwala


People also ask

What is Stackview alignment?

A layout where the stack view aligns the center of its arranged views with its center along its axis. case leading. A layout for vertical stacks where the stack view aligns the leading edge of its arranged views along its leading edge.

What is a UIStackView?

A streamlined interface for laying out a collection of views in either a column or a row.


1 Answers

Suppose you have a two-line text view (or field or label or button) and a three-line text view, and you add them to a horizontal stack view. Do you want to align their first lines, or their last lines? That's the difference.

.FirstBaseline:

.FirstBaseline

.LastBaseline:

.LastBaseline

Note: I increased the vertical content hugging and compression resistance priorities to 1000 (required) to get this to work properly.

like image 174
rob mayoff Avatar answered Sep 23 '22 10:09

rob mayoff