I'm new in iOS-swift. I need to add new text field after clicking "+" button.
Please check this image:
There is one text field already. I need to add
1) one text filed
2) one + button beside new text field
3) - button beside old text field
clicking "+", will add and clicking "-" will remove text field.
any help would be appreciated....
Use Table view.
Design TableViewCell which have textfield and button and custom
twxtfield class must have property for define + or - button should
be added to cell and this property also helpful to handle -/+ with
one button.
When + button clicked you need to add one row to table view and on -
clicked you need to remove row from tableview
you can refer to add/remove check it
1) You can easily achieve it by tableview.
2) One row, in which textfield and + button is there.
3) Once you click on add button, add new row with textfield and - button.
4) Once you click on -, remove row from tableview.
EDIT
Here is demo link, how to add/remove row in tableview
http://objectivecwithsuraj.blogspot.in/2012/10/uitableview-add-or-remove-rows.html
Related
In Google sheets, is it possible to clear selected cells???
when I say "clear" I would like the cells to restore there default font (color/size/style), reset the cell background, reset any cell border style, reset the math functions on the cell, delete any notes or comments add to the cell.
I try to select a few cell and click the "delete" button, that this will only remove the cell value.
yes, that's possible. select cells you want to reset and press CTRL + \ which will handle formatting.
then press BACKSPACE or DELETE for content removal
and you can enter note edit mode with SHIFT + F2
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 two questions:
How can I create a Right to Left form in XLForm (Right label and
Left TextField or other widgets) I tried to get the label or text
field frame but that wasn't helpful.
How can I create a multi valued table with reorder and delete
actions that last button perform a segue and then the result creates
a new row. Assume I want to add multiple pictures and the last row
of table is "Add New" button. but my problem is a delete sign will
appear at the left of that row too. On the other hand I don't want
to add a row like a text filed but I want to set a segue result as
new row.
I am using xib file with label on left side and textfield on right side.
I am using this xib in UI Tableview. I need row value whenever i click on textfield (Right side).
I am able to get row value on left side(Label side) but not on the textfield.
Please help.
Thanks.
Why don't you try with tagging Textfield?
i.e. Give a tag to textfield and on didSelect get that tag by
textfield.tag
and use it wherever you want.
I am converting a sample html app to ios i have a table view with edit button as shown in figure.when i click that edit button the buttons with (-) symbols should appear for all the cells and if i click that minus button that particular cell should get delete.I tried it but i can add only two the last row.Here I am loading the cell from the nib.
If you post your current code we can help you better, however I suggest you to implement this algorithm:
Reload your table, set a default style to your custom cell to hide the "-" button
If user touch the "edit" button, reload you table and set a delete style to your custom cell to show the "-" button
When user clicks the "-" button, delete it from datasource and reload your table