I am setting up a 3 x 3 grid on a wp7 using <grid> and <row/columnDefinitions> for size. When someone taps on a cell, I want the cell to take up the entire 3 x 3 space (so now the grid is 1 x 1). Also when this happens, I need to animate this as a slow zoom up or something similar.
Any ideas where i should I start?
I don't have an exact answer but can note down my initial thoughts that could help you.
It appears the Height and Width properties of RowDefinition and ColumnDefinition are Dependency properties which means you can animate them with a storyboard. You could either create nine storyboards (one for each grid) or one storyboard that you modify in code for the animation required.
Another approach could be using the Visual State Manager, with separate states for each cell you could achieve the effects you're after by altering the row and column definitions. Bit tedious as well since you'll need ten states.
Related
I searched a lot about this, couldn't find an answer and I am stuck with this problem for some days already.
I have a UITableView with 3 sections, each one with custom cells (xib). The first section must grow accordingly with one of its labels.
The second one is static, it shows up just an static image and basic height.
The third one is like a comment cell, with UIImageView, labels etc. One of this labels must grow till a limit height.
I managed to show the 3 custom cells, but the first and the second one (which are not static height), show only partially. If I set manually the Height of the row I can see it entirely, but all section cells grow and it is not what I need.
The constraints to auto layout, I keep getting some conflicts but could not find any solution, tried to debug the view stack, no success.
Custom Cell
Constraints of custom cell
Can anyone help me or point me to a direction?
Thanks in advance!
I had the same problem. I solved it like this. Set tableView estimatedRowHeight to minimum row height. Set tableView rowHeight to UITableViewAutomaticDimension.
1) For dynamic cell height - Give the label leading, trailing, top, bottom and height greater than equals to minimum height.
2) For fixed cell height - Give the label leading, trailing, top, bottom and height equals to fixed height whatever you wanted.
By this your dynamic height cells will grow and fixed ones will be fixed. If you did not get what i said then post a sample project with just this custom implementation on git or somewhere else. I will correct it.
Thank you.
How would I go about setting a custom background image for a UITableView. The wrench in the works is that the table is a grouped style (rounded top corners for the first cell and rounded bottom corners for the last cell). I would like do this as much in code as possible without relying on images too much.
Ideally, here is the solution, but I have no idea if this will work or not:
Create one custom background image
Apply the same custom background image to every cell
Rounding occurs automatically because it is a Grouped table style
Profit.
Is this how it works (besides the profit part... I am an app developer, after all)? Do I need to re-think my approach or is this possible? How would do what I described (or another approach) in code specific to iOS 5+?
Update
Just to clarify a bit, the main question I'm asking is: Does the rounding still occur on the top and bottom cells even if you are using a rectangular image?
Well I think what you are saying is ok, but I suggest creating a unique cell layout in a .nib file and apply there the background. Then, with initWithNibName you can manage every cell at the UITableView's methods on the ViewController.
What i would like to do is create a dockpanel with 4buttons and have the buttons be equal size .
However when i do this now, it formats the first 3 Buttons to fill the Contents of the button and the last button fills the remaining space.
Is there a way to have a control that i can put 4 buttons into and make them equal size. I have already seen the problems with StackPanel and from reading i thought dockpanel would fix this for me.
I know i can use setup a grid to fix this, but i was trying to find another solution.
I don't know which grid you know how to use, but I found the easiest solution is to use a UniformGrid with 1 row. That should fill all the buttons equally.
Initially I was under the impression that it uses the table row slideup/down animations while inserting/deleting new rows but I doubt if it's doing that as it does it so fluidly even with thousands of items in the list (otherwise it would take a lot of time for the deletions/insertions to work).
Am I right in my assumption that it's simply attaching a new instance of the News list at the bottom of the screen, shrinking the above one while the one at the bottom expands to fill up space?
UPDATE:
Please see this video of what I mean: http://dl.dropbox.com/u/4960327/ReederAnim.mov
I can not tell you exactly how Silvio Rizzi made this, but as you see in the playback, a list view is added behind the shown list view, and the front list view fades out (.alpha = 0.0;) while the list view behind it expands its height per row.
When you desicate it frame by frame it becomes quite clear what he does, and it is really not that advanced. But I have to admit, with the white "milky" polished interface, it looks quite neat.
In addition, you can see that while animating, the background list view only renders the top 7 entries (hopefully calculated by dividing the view height with the average height of the cells shown) making the list view quick to load. Then afterwards, he can load an extended array of cells once you start scrolling, or in a background thread starting once the animation is complete.
I'm building a grid using UIViewTable and adding 4 items for each cel.
However, when I rotate to portrait, I need to reduce the number of items from 4 to 3. And therefore I recompute the rowsArray and I display again the table.
Is this the correct way to proceed ?
thanks
I advice you to use AQGridView
https://github.com/AlanQuatermain/AQGridView
It's an open source grid implementation that is simple and that have many samples.
otherwise, if you add items like described, you will have to redraw all cells content every time the orientation change