My application has a UITableView which is editable to be able to delete items. When a user taps the red circle on the left of the cell it reveals a red 'Delete' button. When that 'Delete' button is tapped I am displaying a custom confirmation dialog. If the confirmation is true then deletion proceeds normally. If it is false I want to automatically go back to the state before the red circle was tapped. I have tried setEditing: but it removes the circle completely. The other two methods are setSelected: and setHighlighted:. They don't make any change. Is there a way to do this?
Related
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.
I have a UI with a Save button on the top and with Grid columns setted to cellEditOnFocus : true, when I'm editing a cell and I have to do a scroll to the top to click the Save button it doesn't get called. I have to do another click, I also observe that the Scroll of the page goes back to the position of the row I was editing.
If I don't have to scroll the Save function works on the first click.
How can I avoid this behavior?
I am making a fitness app using swift 3.
What I am trying to do is to have a text field where the user enters the exercise then under that another three text fields (one for the sets, reps, and weight). When the user clicks the "Add exercise button" underneath it repeats these text fields so the user can fill in the next exercise and so on.
How do I get the four text fields to pop up again after the user presses the "Add exercise button?
Thanks
Make Simple TableList. when hit Submit button just increase Field List Count . TableList has only cell in start .
func addNewField(){
FieldListCount = FieldListCount + 1
tableView.reloadData
}
You can do that with UICollectionView and add footer to collectionView. For example:
Create a collectionView, each cell in collectionView has some textFields. And footer of this collectionView has a button "Add new exercise".
When button is tapped, add new cell to collectionView.
Preferred Solution :
User Custom Text Field view and on the press of submit button, after that add that TextField View into UIScrollView with increment in Y position. If use tableList some textField will not be created(not in memory) until the user will scroll the table list.
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
Is it possible to see the selected state content of an UIButton only when I'm touching it?
When you're touching a button, the button is highlighted. Call setTitle:forState: to give the button the normal title (UIControlStateNormal), and call setTitle:forState: to give it the highlighted title (UIControlStateHighlighted). Now you'll see one title normally and the other title when you touch the button. The same thing for the other button features, like setImage:forState:.