Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to customize my UITableView cell as below

enter image description here

Am using custom tableview cell in my code. Please can anybody help me how to write the code for common friends cell. How can i get the names AMANDA,VIKA LEVINA,NATASHA,KATE,JESICA names in rectangular box.

like image 798
Vinathy nvr Avatar asked Nov 16 '15 09:11

Vinathy nvr


People also ask

How can we use a reusable cell in UITableView?

For performance reasons, a table view's data source should generally reuse UITableViewCell objects when it assigns cells to rows in its tableView(_:cellForRowAt:) method. A table view maintains a queue or list of UITableViewCell objects that the data source has marked for reuse.


2 Answers

For common friends and Facebook interest cells you can use UICollectionView and adjust cell width depends upon text otherwise you can use one of below listed controls.

https://www.cocoacontrols.com/controls/jctaglistview

https://www.cocoacontrols.com/controls/taglistview

https://www.cocoacontrols.com/controls/antagsview

like image 113
Narayana Avatar answered Nov 15 '22 10:11

Narayana


you have to design two custom cells in your IB first for image view cell and other for list given below in your cell. create two custom cell in IB and design them according to your need and after that in your cell for row at index path method differentiate between these cell like:

uitablviewCell *cell;
if(indexPath.row == 0)
{
        cell = [tableview dequereusablecellWithIdentifier:Firstcell];
}
else
{
       cell  = [tableview dequereusablecellWithIdentifier:secondCell];
}
like image 34
Divyanshu Sharma Avatar answered Nov 15 '22 09:11

Divyanshu Sharma