Is there a way to define a space for a particular cell? I am able to set spacing for all cells with the following property in gridview:
_grid.columnSpacing
I display five views on the screen. I need to set more spacing only for the second and the fourth views that are displayed on the screen.
Hi,
ColumnSpacing is uniform. So it can only be applied to all or none.
If you want additional space on a particular column, your best option is a custom cell, and insetting your content.
-SteveZ
Hi Steve, insetting you mean updating it's frame( origin.x ) during the transition?
This is the screenshot that I need to replicate. The min and the max values in the CarouselViewController are exactly matching with the circle sizes on the screenshot. On the right side, the first cell's size starts from 0.4 and the centre circle's size is 1.5.
Like I said my only problem is displaying the second circle close to the left side and displaying the fourth circle close to the right side. Thank you Steve..
Just found a couple of bugs and fixed it. Please use this project.
I didn't use your project. I just updated mine for now, as i was in the middle of making it work when you sent it to me.
This updated project will always have 5 cells in view, no matter the size of the view controller. So if you use a phone or rotate the iPad, it will alway display 5 items.
Let me know how this works for you.
Hi Steven, thank you for the new sample! That's awesome..
The only missing thing is the center view's size. It should knock the second and the fourth views. The rest of the view sizes are perfect How can I make only the centre circle more bigger? for instance I tried max = 2.1 but it gave me the screen below. The second and the fourth circles have covered the first and the fifth circles.
Sure.
You can't just increase the Max scale, b/c that will affect all the cells relative size.
Instead, you need a little big of additional logic.
I've adjusted the sample. There is a new local variable:
CGFloat additionalMulitper = .5f; // Increase this to make the center circle even bigger
To make the center item bigger, just increase this multiplier and you should get your desired results.
Hope this helps,
Thank you so much Steve for your great technical support!! I really appreciate it.
No problem.
You can actually control that with the existing sample.
There is a variable called spacing. This is the spacing between cells.
You can play around with that variable until you find something that works for you.
CGFloat spacing = scaledItemSize/2; // Try making it something like scaledItemSize/2.75 to decrease the spacing
Let me know how that works for you.
CGFloat spacing = scaledItemSize/2.1;
gives me this screenshot. I only need to adjust the spacing at the left and right side of the centre circle not all spacing in between the circles.
Thank you Steve. I really appreciate your technical support! The following setting is really nice. With the help of this parameter I am able to adjust the center view's size.
I still need to slightly bring the circles under the centre one. Is there a way for to do this with another parameter? like distancefromcenter = .2f; will bring the circles close to the center circle. The sizes of the circles are ok except the space next to the centre circle.