Skip to main content
added 4 characters in body
Source Link
sonle
  • 8.5k
  • 2
  • 14
  • 27

You can't do it directly. However, there are a few tricks to archive this layout.

  1. Add two labels, aligning them one to the left and one to the right.

enter image description here

  1. Add two labels and a space between them.

enter image description hereenter image description here

Notes: Be careful when setting content hugging priority for these views. i.e. if you want the left one always show up fully (without trimming "..."), increase its content hugging priority horizontal.

You can't do it directly. However, there are a few tricks to archive this layout.

  1. Add two labels, aligning them one to the left and one to the right.

enter image description here

  1. Add two labels and a space between them.

enter image description here

Notes: Be careful when setting content hugging priority for these views. i.e. if you want the left one always show up fully (without trimming "..."), increase its content hugging priority horizontal.

You can't do it directly. However, there are a few tricks to archive this layout.

  1. Add two labels, aligning them one to the left and one to the right.

enter image description here

  1. Add two labels and a space between them.

enter image description here

Notes: Be careful when setting content hugging priority for these views. i.e. if you want the left one always show up fully (without trimming "..."), increase its content hugging priority horizontal.

Source Link
sonle
  • 8.5k
  • 2
  • 14
  • 27

You can't do it directly. However, there are a few tricks to archive this layout.

  1. Add two labels, aligning them one to the left and one to the right.

enter image description here

  1. Add two labels and a space between them.

enter image description here

Notes: Be careful when setting content hugging priority for these views. i.e. if you want the left one always show up fully (without trimming "..."), increase its content hugging priority horizontal.