ios - Add view to a cell in a Table View Programatically -


i have table view dynamic prototypes displaying 4 elements programmatically. assign cell names through array (see code below), want add small view right half of each cell in order show small graph next each label. can drop in view in storyboard, doesn't extend dynamically. need find way modify code add view inside of each cell , assign class have created views.

    override func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell {     let cell = tableview.dequeuereusablecellwithidentifier("linecell", forindexpath: indexpath) as! uitableviewcell     cell.textlabel?.text = oneline.linenames[indexpath.row]     return cell } 

this want views:

enter image description here

also, how can make more space between carrier, time, , battery , table view?

you can create view want , add subview of cell's contentview:

var newview = uiview(frame: cgrectmake(200, 10, 100, 50)) cell.contentview.addsubview(newview) 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -