AQGridView icon indicating copy to clipboard operation
AQGridView copied to clipboard

Possible to adjust cell offset

Open karmeye opened this issue 11 years ago • 3 comments

Is it possible to adjust each individual cell's position?

I have a shelf background, and the items are not properly aligned to the shelves. The cell items are of different sizes.

Thanks.

karmeye avatar Nov 02 '12 15:11 karmeye

Absolutely: implement the -(CGRect)gridView:adjustCellFrame:withinGridCellFrame: method in your AQGridViewDelegate. That is passed the CGRect for the cell's default frame along with the CHRect of the logical bounding box within which it is by default centered. Assuming your shelf sits N pixels above the bottom of the grid, you can just adjust the default frame so it's bottom sits N pixels above the bottom of the bounding box.

This is actually the exact same case for which the method was originally created: laying out books on the Kobo app's shelf view.

Sent from my iPhone

On 2012-11-02, at 11:51 AM, rassol [email protected] wrote:

Is it possible to adjust each individual cell's position?

I have a shelf background, and the items are not properly aligned to the shelves. The cell items are of different sizes.

Thanks.


Reply to this email directly or view it on GitHub.

AlanQuatermain avatar Nov 02 '12 15:11 AlanQuatermain

Perfect! Thank you!

karmeye avatar Nov 02 '12 17:11 karmeye

Is there support for different sizes of cellFrames? When I adjust the cellFrame according to the cell image size the spring board example stops working when moving cells.

karmeye avatar Nov 06 '12 13:11 karmeye