GithubHelp home page GithubHelp logo

Comments (8)

lucdion avatar lucdion commented on May 15, 2024

Hi @wjling, sorry for all that issues, since I have change the way PinLayout update view's frame (https://github.com/mirego/PinLayout/releases/tag/1.5.2), this change have impacted few details that were not covered by unit tests, this was particularly affection UIScrollView/UITableView. This has all been fixed in the release 1.5.7 and 1.5.8.

If you update your project to the latest release 1.5.8, everything works fine, I've tested your sample.

Thanks for using PinLayout, and don't hesitate to report any issues ๐Ÿ™‚

from pinlayout.

wjling avatar wjling commented on May 15, 2024

Glad to hear that you fix these issues! PinLayout is a convenient layout tool!

from pinlayout.

wjling avatar wjling commented on May 15, 2024

Hi @lucdion . I want to share my thoughts about the release 1.5.2, only about the transform. I think this release make PinLayout a bit different with manual layout when we apply transforms. If we apply a rotation in a view, we can't use PinLayout to layout its final frame. We should calculate view's layout before we apply rotation, then we use PinLayout. If a view has been rotated, we can't use PinLayout to apply something like top(), marginLeft(3). Because these top(), margin are relative to the status that the view hasn't been transformed. But previous release can perform well. Finally I think PinLayout doesn't do well when there are transforms. It is my feedback after experiencing the changes in 1.5.2. What do you think about my problem?

from pinlayout.

lucdion avatar lucdion commented on May 15, 2024

Hi @wjling, thanks for sharing your tought. Could you share me a sample of your problem?
If I understand correctly, you have a view with a rotated transform, and you'd like to pin it at the top. Your view is non-square?
First think I want to understand correctly the issue, then we could think of different solutions to configure how PinLayout apply layout to its view that contains a transform.

But it could help me a lot if you could just share me a little piece of code that expose this situation.

Thanks

from pinlayout.

wjling avatar wjling commented on May 15, 2024

Hi @lucdion .Maybe some pictures can help to explain myself. Sorry about the poor painting๐Ÿ˜….
I have picture in an imageView (the red border one):
911518008279_ pic
I perform a 90ยฐ rotation on it and I want it to be the same frame, like this:
931518008546_ pic
But PinLayout make it like this:
941518009274_ pic

If a view has applied some transformation, I think is hard to use top(), left() or other constraints to layout it. The reference system has been changed because of transformation. top() or left() is not performing the way we think about it in current reference system.

Maybe you can understand what I say. I also update the demo: https://github.com/wjling/PinTestDemo1

from pinlayout.

lucdion avatar lucdion commented on May 15, 2024

Hi @wjling, thanks for the details.

Since release 1.5.2, PinLayout now respect the view's transform and doesn't modify it. So if for example you have applied a rotation transform, PinLayout will adjust the position and the size of the untransformed view.

In your case you want to update the position/size of the rotated view. But suppose you would like to obtain the PinLayout's result, i.e. keep the rotation transform but change the position and the size of the view, you wouldn't be able by setting the frame property.

This is in fact two different scenarios. I think it requires a mechanism to specify which one we want to use.

I propose to keep's PinLayout current behaviour (I think its easier for animations), but adds a pinFrame property to really apply the new position/size to the view's frame.

In your example it would replace:

  tableView.pin.top(80).left().right().height(100)

By:

  tableView.pinFrame.top(80).left().right().height(100)

I'm not sure yet about the name pinFrame.

Comments?

from pinlayout.

wjling avatar wjling commented on May 15, 2024

@lucdion Yes, there is two different scenarios. I am in such scenario that I should operate a lot of animations in a view. In this scenario using manual layout maybe less calculation and more understandable than PinLayout.

If we can choose which way of Pin to use in different scenarios could be a nice solution. It will make PinLayout more flexible. Just suggestions. Maybe it can be treated as an enhancement in later releases.

from pinlayout.

lucdion avatar lucdion commented on May 15, 2024

Hi @wjling, the following release (https://github.com/mirego/PinLayout/releases/tag/1.5.9) add a pinFrame property.

https://github.com/mirego/PinLayout#uiviews-transforms

from pinlayout.

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.