Comments (10)
Take the 3-columns for example: each column is 100 in width. If the image is 150_180, after calculation, the frame size for its cell shall be 100_120. This frame will make the imageview itself resize by scale. The key point is, knowing the height for each image, and then calculate the frame. In the demo, I just use random heights for each cell, not the real height of the images, so there are margins if you UIViewContentModeScaleAspectFit is used for the contentMode. I suggest try it with images of which heights are already known, otherwise the frames may not be very precise.
from waterflowview.
I see that it's possible now, just using the flowView:heightForRowAtIndexPath: method. I'll try it out. Thanks.
from waterflowview.
you're most welcome
from waterflowview.
Just curious, but have you done any other layout prototypes similar to this? I'm looking to build something like iPhoto for iOS's journals, or what is seen on 500px.com. It is similar to your layout, but allows images to span multiple columns. I like masonry layouts but feel they focus too much on portrait-oriented images at the expense of landscape orientations-- because an image can be as tall as it wishes, but can only be as wide as its column.
from waterflowview.
hi Alaric, shame that i didn't look deep into the organism of iPhoto myself because I haven't got one on my devie... but from the display of 500px.com, i assume that the layout is based on a table (which i thinks make it easier than iPhoto in implement). Each row (or cell) is fixed in height, but what's inside depends on the pattern or template you choose. I can find 5 templates at least to split the cell into 2, 4 or 5 photos in 500px. Each time a cell is setup, how about using a template property for the way to split it?
from waterflowview.
That's true. Looking into it more, 500px does crop their photos to fit within a few predefined templates. I suppose I'm looking into something more complex that would not crop images but would do something in between a pinterest and 500px style. Assuming images would typically have the same aspect, but with some vertical and some horizontal.
On Jun 10, 2012, at 6:25 PM, Bertie [email protected] wrote:
hi Alaric, shame that i didn't look deep into the organism of iPhoto myself because I haven't got one on my devie... but from the display of 500px.com, i assume that the layout is based on a table (which i thinks make it easier than iPhoto in implement). Each row (or cell) is fixed in height, but what's inside depends on the pattern or template you choose. I can find 5 templates at least to split the cell into 2, 4 or 5 photos in 500px. Each time a cell is setup, how about using a template property for the way to split it?
Reply to this email directly or view it on GitHub:
#4 (comment)
from waterflowview.
I think about iPhoto journal for a while, based on a picture from http://www.techgatherer.com/wp-content/uploads/2012/03/iphoto-for-ipad-and-iphone-review-2pTEXC.png . It seems to me, that there are 5 kinds of size for pictures, and the rule for layout is, keep layouting until the pictures form a rectangle that could be taken as a cell for reuse.
from waterflowview.
Hi Alaric, actually i've been looking into your idea and have got so far: http://ptzplace.lockerz.com/s/217315435. I'm not sure how apple made it, but my algorithm is to calculate the weights of photos based on a 40*40 square. If you're interested, you could reach via email for further discussion.
from waterflowview.
Sure. What email address should I use?
On Jun 15, 2012, at 3:24 AM, Bertie [email protected] wrote:
Hi Alaric, actually i've been looking into your idea and have got so far: http://ptzplace.lockerz.com/s/217315435. I'm not sure how apple made it, but my algorithm is to calculate the weights of photos based on a 40*40 square. If you're interested, you could reach via email for further discussion.
Reply to this email directly or view it on GitHub:
#4 (comment)
from waterflowview.
[email protected] Gmail's good with me.
from waterflowview.
Related Issues (6)
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 waterflowview.