Skip to content

Instantly share code, notes, and snippets.

@bjhomer
Last active January 3, 2016 09:59
Show Gist options
  • Save bjhomer/8446132 to your computer and use it in GitHub Desktop.
Save bjhomer/8446132 to your computer and use it in GitHub Desktop.
Positioning the center of viewB a fraction of the way along viewA
You can't do this directly, but it can be done by using a hidden spacer view. (Here, viewC)
viewC.left = viewA.left
viewC.width = viewA.width * multiplier
viewB.centerX = viewC.right
Produces this.
|----------viewA----------|
|-viewC-|
|--viewB-|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment