Changing all cells colour except the cell i selected? - ios

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.

Related

Checkmark pushes cell content in UITableVIewCell

I'm building a filter view controller.
The top section is a selectable list that the selection is being marked with checkmark.
My problem is that the checkmark pushes my textlabel to the left.
The UITextLabel is aligned right to left.
How do i disable the checkmark from pushing the textlabel so it would work like the ringtone selection viewController in iphone (for example)
You have to handle manually the checkmark adding an UIImage at the left of the UITableViewCell and not using accessoryType because it appears only at the right: https://developer.apple.com/documentation/uikit/uitableviewcell/1623228-accessorytype
But if you want to still use accessoryType you can give more space at the right of the UILabel.

How to create tableview cell selection style color static?

I am trying to create tableview cell selected to show selection color statically upto go another view controller. Now I am facing whenever I clicking the cell its highlighted. I want to show statically after selection cell.

How to create expandable table view in ios?

On click of table cell it will dynamically increase the label height and if user click on another cell previsoly opened cell will collapse and expand selected cell.I was try hard for this bt label text is not working well.I want increase the height of cell.exa- click on question cell it will expand the answer
Connect UITableViewCell to the code behind, have a state for that cell and on didSelectRowAtIndexPath change cell height to whatever value you want. Regarding of the state of the cell ( you can do this by checking its height as well ) shrink or expand the cell.
You can do this by adding another cell below "question" cell and make it visible or hidden on click as well.

UITableViewCell highlight only part of the cell?

I have a standard UITableViewCell on which I add a few extra views to in order to create a custom look. One of these such views is a UILabel that I've put a border and background color on, in order for it to look sort of like a separate bubble. When a user taps on the cell, I want it to still highlight, but only on where this UILabel is, not the entire cell (it looks ugly when it highlights the whole cell). How can I do this?
Anything with the selection style of the cell seems to only change the color or style, but I want to change the area of the cell that is highlighted.
Thanks in advance.
Another way to achieve it is,
In CellForRowAtIndexPath, check whether the index path of the cell you are rendering is same as tableview.indexPathForSelectedRow. If same, give a highlighted look which you want.
In didSelectRowAtIndexPath reload the previously selected cell and currently selected cell.
[You have to cache the previous selected index to reset the highlighted look.]

how to add data separately in cell of tableview separately

I'm having three buttons on table view cell and have to show some text on label below it but when i'm clicking on button and selecting text it shows in all row and if second button clicks data of first label get blank so is their any way to fill data seprately to cell of table view
Yes it is you have to test for indexPath to see if that cell will display or not what you want. And keep in mind that cell are reused so you have also to remove content from cells or use different cell identifiers for each type of cell.

Resources