I've made an app (for iOS) that shows a ListView with product information on it.
On the left of the row, I have a button to add the product to the orderlist. However when I click the button, the entire row changes color. I don't want this, I want the row to stay the same when it is clicked.
I've tried to set the allowSelection property to 'false', but then the 'itemclick' event doesn't fire anymore, so that's not the solution.
I also tried to set the selectedBackgroundColor property to 'transparent', but this still changed the color of the row when the button is clicked.
Is there any easy solution to this? Thanks.
Use "selectionStyle" property of the cell class, example shown below,
cell.selectionStyle = .none
By this usage the selection will occur but it wont change the color on highlighting(selecting state) of the cell.
Related
I'm trying to find function that will change (toggle) cell color when you would click on it.
For example, I have cell that that only has number "1" on it and it's default color is white, so when I click that cell (like you would on click on a checkbox) the color should now be blue. If you would click it again, the color should go back to white etc.
What I tried so far:
Using Dta validation to change checkbox value to text so that both TRUE and FALSE statements simply are written as number 1, but I got validation error that both states couldn't be named the same
Using Conditional formatting. so when checkbox is checked, color of that cell is changed (this works to some degree, but for some reason not when I use it together with Data validation)
Does anyone have solution on how should I approach this?
In theory it could be possible with the onSelectionChange trigger on an apps script function. It could be a simple function that:
Gets the selected or active cell range
If the background color is white, changes it to blue
If the color is already blue, changes it back to white
Changing color is already doable with the setBackground function.
I am using voice over on checkbox.
The issue I am facing here is,
when user selects the checkbox for the first time it says 'checkbox selected' (which is correct as per accessibilityLabel set) but next time when user tries to de-select it says 'checkbox selected, checkbox de-selected' where it should only say 'checkbox de-selected', vice-a-versa.
So what is happening here is that, the previously set accessibilityLabel is not getting cleared up and when user tries to select or de-select it takes the both previous and currently set label.
Note- using custom checkbox, toggling UIButton with selected/de-selected image.
How to solve this conflict?
If you create your checkbox thanks to a UIButton item, I suggest to :
Untick the button UIAccessibilityTraits.
Provide a clear hint when the checkbox is first selected : "double tap to change the value".
Update your button accessibility label thanks to IBAction when the box is toggled.
However, it's always better to create a UIAccessibilityElement that contains your check box and a label that describes what it refers to ⟹ when you double tap this accessible wrapper with one finger, the checkbox value toggles and your initial problem disappears.
Following these steps will provide an appropriate user experience with no checkbox VoiceOver conflict that you noticed.
I have a custom cell where it displays a table like structure with multiple columns.
Each row has a column that is a button that will perform different tasks.
My issue is trying to get the middle column to communicate its state with the other rows.
Initially everything will be grey (not selected) but, when I tap the middle column button, the state will be green. When I select a different row that button will turn green and the previous row would be grey.
Again, each column in the row is a button that does something different (i.e. the right button loads up a modal view). I have tried to use
didSelectRowAtIndexPath but, with the overlapping custom views it does not seem to read the selection.
Any help would be appreciated
I want to create several controls just like the ones below the date time picker in the alarm app. They look like label controls, but they have a title on the left, the currently selected data value on the right, and an arrow all the way to the right. The Snooze control does not have an arrow, but I believe it is the same control. What type of control would I use to do this?
Any samples out there for this in Swift?
Thanks in advance.
It sounds like you are talking about different styles of cells of a table view.
The first control you mentioned (label on left, selected data value on right) is simply a table view cell with the RightDetail style and Disclosure Indicator accessory view.
The control with the switch is not a default cell style so you will have to make your own custom Table View cell. There are plenty of tutorials online that show how to make your own style of Table View cells. The item on the right is just a regular Switch.
My question is very simple but I really didn't find any solution here.
I have a Table setSelectable(true), setMultiselect(false), setImmediate(true).
It works fine by first click and moving through the table using arrows.
But if I click again to the row already having been selected,
then it becomes unselected. How to prevent it?
I'd like to have kept just one row always selected.
As from the Vaadin Book here:
If the user clicks on an already selected item, the selection will deselected and the table property will have null value. You can disable this behaviour by setting setNullSelectionAllowed(false) for the table.
So:
table.setNullSelectionAllowed(false);