# Flexible center label

**URL:** <https://forums.kodeco.com/t/flexible-center-label/28142>\
**Category:** iOS\
**Created:** [April 8, 2017, 5:46pm UTC](https://forums.kodeco.com/t/flexible-center-label/28142 "2017-04-08T17:46:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonny](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jonny/32/79544_2.png) [@jonny](https://forums.kodeco.com/u/jonny)\
**Post date:** [April 8, 2017, 5:46pm UTC](https://forums.kodeco.com/t/flexible-center-label/28142/1 "2017-04-08T17:46:49Z")

</div>

Hi

I’m just wondering how/if it’s possible to align three objects with this format, where the center label is flexible in length?

```
button -- label -- button

```

So I could pin both buttons to the top of the screen and the side, define their height and width and allow the label if I pinned both sides to the it’s nearest button. Would it become flexible in length? Is that the best way to achieve this?

---

<div class="post-metadata">

**Author:** ![rcasey](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/rcasey/32/82229_2.png) [@rcasey](https://forums.kodeco.com/u/rcasey)\
**Post date:** [April 8, 2017, 10:49pm UTC](https://forums.kodeco.com/t/flexible-center-label/28142/2 "2017-04-08T22:49:49Z")

</div>

That should work. The label will take up all the space between the two buttons. Setting the label attributes to center the label’s text should give you what you want.

Have fun!

---

<div class="post-metadata">

**Author:** ![jonny](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jonny/32/79544_2.png) [@jonny](https://forums.kodeco.com/u/jonny)\
**Post date:** [April 9, 2017, 2:15am UTC](https://forums.kodeco.com/t/flexible-center-label/28142/3 "2017-04-09T02:15:16Z")

</div>

Thanks so much for your help as always!
