Giter Club home page Giter Club logo

autolayoutanchorpointtestrig's Introduction

This rig is for examining how autolayout interacts with a view when view.anchorPoint and/or view.transform have non-default values.

To use:

  • turn autolayout on/off using the #define in the .pch file in Supporting Files/
  • switch between center- and edge- based constraints with the global in ViewController
  • turn on/off "frame restoration" on anchorPoint with the global in ViewController

The problem:

  • before autolayout, it was easy to set anchorPoint without moving the view by caching the frame
  • before autolayout, it was easy to set anchorPoint in the presence of transforms without moving the view, by directly compensating for the transform
  • after autolayout, you need to tweak layout constraints to set anchorpoint without moving the view
  • after autolayout, it's totally unclear how to compensate how to compensate for transforms in a way analogous to the world before autolayout, because autolayout tries to clobber the effects of some transforms but not others.
  • when you're setting an anchorPoint, you're usually also setting a transform, so this is not a corner case

Observations:

  • view.center is not the center of view.frame (when anchorPoint and/or transform is non-default)
  • autolayout constraints view.center not the center of view frame.

autolayoutanchorpointtestrig's People

Contributors

algal avatar

Watchers

 avatar  avatar

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.