RFQuiltLayout icon indicating copy to clipboard operation
RFQuiltLayout copied to clipboard

Cell Size based on content?

Open thedangler opened this issue 12 years ago • 2 comments
trafficstars

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

thedangler avatar Oct 22 '13 03:10 thedangler

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!

bryceredd avatar Oct 22 '13 14:10 bryceredd

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: https://github.com/bryceredd/RFQuiltLayout/issues/12#issuecomment-26809248

thedangler avatar Oct 22 '13 22:10 thedangler