Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cell Size based on content? #12

Open
thedangler opened this issue Oct 22, 2013 · 2 comments
Open

Cell Size based on content? #12

thedangler opened this issue Oct 22, 2013 · 2 comments

Comments

@thedangler
Copy link

Hey, I'm just wondering how I should use this for printing labels inside the cells.
If I return the label size in the blockSizeForItemAtIndexPath: method it makes the cell way to big because its multiplying it by the blockPixels or something of that nature.

Any ideas?

M

@bryceredd
Copy link
Owner

So how this works is you define how big a block is, then you specify how many blocks a cell takes up - this is an optimization for speed, and it helps fit all the items together.

Think of the quilt layout like legos: block pixels specifies how big the 1x1 lego unit is, then block size will determine how big the lego piece is in terms of lego units.

You could try setting blockPixels to 1, and returning the exact size of the label in blockSize, but I'm not sure how that will perform!

@thedangler
Copy link
Author

Hey. Thanks for the answer. After messing around for a bit using 1x1 seems like it should have worked but it was a little messy looking. I don't know if that is because of the label size not being calculated correctly or something else.  What was happening is the width of the label always seemed to e a bit bigger than the block.  

M


Sent from Mailbox for iPhone

On Tue, Oct 22, 2013 at 10:46 AM, bryceredd [email protected]
wrote:

So how this works is you define how big a block is, then you specify how many blocks a cell takes up - this is an optimization for speed, and it helps fit all the items together.
Think of the quilt layout like legos: block pixels specifies how big the 1x1 lego unit is, then block size will determine how big the lego piece is in terms of lego units.

You could try setting blockPixels to 1, and returning the exact size of the label in blockSize, but I'm not sure how that will perform!

Reply to this email directly or view it on GitHub:
#12 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants