Editable table view cell

I am creating an application. I have to implement the bookmark function, and the addition should look like this:

mmm http://img534.imageshack.us/img534/9859/schermafbeelding2010040a.png

I want to edit UITableViewCellto enter text. I was wondering if there is an easier way than pasting UITextFieldin UITableViewCell. And if not, can someone explain how I can use UITextFieldinside it? Thanks

+3
source share
3 answers

There is no simpler way, you have to subclass UITableViewCell and add to UITextField. Here's a tutorial for using UITextView should be about the same as UITextField.

+5
source

You can simply add a text box to the contentView of your cell and a button (X) in the accessory of your cell. You can do this in a subclass of UITableView that will allow you to add tracking for your added items using variables or instance properties.

I found this useful: Cocoa With love: a simple custom UITableView drawing

Like this:

cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault 
                              reuseIdentifier:@"myEditableCellId"];
label = [[UILabel alloc] initWithFrame:CGRectMake(x, y, w, h)];
[cell.contentView addSubview:label];
+2
source

Source: https://habr.com/ru/post/1739863/


All Articles