Comments (8)
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.
Glad to hear that you fix these issues! PinLayout is a convenient layout tool!
from pinlayout.
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.
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.
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):
I perform a 90ยฐ rotation on it and I want it to be the same frame, like this:
But PinLayout make it like this:
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.
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.
@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.
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)
- "view.keyboardLayoutGuide.layoutFrame" is (0,0,0,0) before using "view.pin.keyboardMargins".
- How do I auto-size the container of image view and label? HOT 5
- invalid parameter not satisfying: !cgsizeequaltosize(size, cgsizezero) HOT 7
- Can I use autoSizeThatFits on collection view cell ? HOT 5
- Can I let View A cover B half? HOT 2
- Crash: PinLayout.swift - Line 1236 HOT 7
- How to align base line of two UILabels?
- Interview partners for research about communication in GitHub projects wanted
- H
- Unable to build with Carthage HOT 2
- Crash: PinLayout.swift - Line 1236
- How to use with NSSplitViewController? HOT 3
- How to add separator line below row/cell?
- UIButton with image .aspectRation() not work HOT 1
- Attach view to different edges or use priorities
- Document missing link HOT 1
- ABI stability for swift evolution support for different swift versions
- Problem with sizeToFit - autoSizing HOT 1
- Edge offsets (.top(x), .bottom(x), .start(x), .end(x)) aren't used in autoSizeThatFits HOT 1
- Work on watchOS?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pinlayout.