Giter Club home page Giter Club logo

Comments (4)

cowgp avatar cowgp commented on May 27, 2024 1

@sdyalor your example forces the entire width because you are using pipes on both sides which creates a constraint with default margins to the edges. With |-a-10-b-| view a is given a left constraint to it's container's left + default margin. view b is given a left constraint to be view a's right + 10 AND a right constraint to be it's container's right - default margin. If you removed the pipes and just did a-10-b then they will not span the whole width. They would likely be left aligned because autolayout has no other instructions of how to lay them out.
if you wanted them centered with 10 pixels between them it's easier to to use the dot notation and do:

a.Right == parent.Center - 5
b.Left == parent.Center + 5

where parent might be an implied "self" depending on the complexity of your layout.

from stevia.

s4cha avatar s4cha commented on May 27, 2024

@sdyalor can you provide a image/ visual representation of want you want please ?

from stevia.

NikKovIos avatar NikKovIos commented on May 27, 2024

image

Now:

imageView.Trailing == titleLabel.Leading + 12
imageView.Trailing + 12 == titleLabel.Leading
image

and

imageView.Trailing == titleLabel.Leading - 12
imageView.Trailing - 12 == titleLabel.Leading
image

It's a little bit strange. I wait that it would be like imageView.Trailing == 12 + titleLabel.Leading or imageView.Trailing + 12 == titleLabel.Leading to work as i need, but it don't. I think it should be in wiki.

from stevia.

BayramInanc avatar BayramInanc commented on May 27, 2024

@NikKovIos when you go right direction, x coordinates increases. If you go left side x coordinates decreases.

In this picture, label's leading edge should be greater than red views's trailing edge. Why?
The reason is label is on right side according to red view.

from stevia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.