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?
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 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.
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.
Thank you so much Steve for your great technical support!! I really appreciate it.