I'd like to apply a Fill colour to a cell, if it has a different value to the cell above it (same column).
I could do that for one cell, by using Conditional Format Rules
Apply to range = target cell
Format rules = If not equal to
Value or formula = previous cell
However, the formatting failed when I dragged the cell down through the column (the range) so they would all get the same formatting - it always referenced the original Value, instead of using the "cell above this one".
In conditional formatting you do not have to drag down a cell.
Instead you need to apply it in a range.
Related
So I have this custom formula for conditional formatting in google sheets
=(A2 <> "")
I want to copy this rule to all the cells in a row. When I try to apply it to the whole row it doesn't work.
This happens:
only the cell next to the cell with text has its color changed
I want the whole row to change color if I have text in the A2 spot.
Thanks!
If you add $ =($A2<>"") it will lock the row reference and therefore mark the whole row green.
I am trying to add a gradient to the first cell in my UITableView.
Here is the if statement I use to determine if the cell is the first in the table.
if (indexPath.row == 0 && indexPath.section == 0) {
This code does not seem to be working as there are a few cells with the gradient, notably the first and last cell along with sometimes the second cell. This is rather odd as the information I am grabbing in the array using indexPath.row is getting the information from the correct position.
Why is my if statement not working? Even though I am grabbing information from the correct location in the array.
You are probably not implementing prepareForReuse in your custom UITableViewCell subclass. It looks like you are correctly targeting the first cell, so perhaps when that cell is later reused for other index paths you aren't clearing the gradient you added earlier.
Make sure you have an else condition to go along with your if. Because table view cells are reused, you need to make sure to remove the gradient if it is in a cell other than the first one.
if(first cell)
add gradient
else
remove gradient if it exists
If you're using custom cells, set the custom cell gradient variable to clear colour on all but the first cell.
If you're using standard uitableview cells, add the gradient to every cell as default and then if it's your first cell change the gradient colours to whatever you need it to be, and clear colour as default.
Alternatively clean all subviews from the cell after allocating it like this:
for (UIView * sub in cell.subviews){
[sub removeFromSuperview];
}
Then add your gradient for the first cell.
Option 1 is the cleanest.
Defaultly, it provides default separator between cells not for the first and last cell.
So first cell has no upper separator and last cell has no footer separator.
I need default one, not to make as UIView...
Is there any way to solve this problem?
If you don't want to create a custom border you can add a 'Dummy' cell of height 1. That will get you the default border.
You could do this putting small header and footer on your tableview.
You can create those with custom cells in your storyboard.
im new to iOS so have mercy xD.
I have a question, when i click in one cell, i want all the other cells text colour to be changed except the cell i selected, so the cell which i selected should not change text colour, just the other cells.
I have few types of cell in table view and sometimes, for some field, these types are merged in one cell. For instance, I have cells for date and for simple text input, but sometimes those cells can be merged in one like here :
If any chance I can use UITableView standard pool for reusing this cells (inside one that include them).
My concern is when I get 3 cell inside tableView:cellAtIndexPath: (compound cell, date and text cell). When compound cell will be released table view will reuse date and text cell too? How tableView knows if it's use cell or not?
I know it can be done with custom layout for UICollectionView, but I want to know is that feasible for UITableView