Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you are looking for some other solution for your problem, then I would suggest you to create a custom cell programmatically.</p> <p>I am Explaining you step by step, this will help you better.</p> <p>So for that create a class which inherit from <code>UITableViewCell</code>, and add components that you needed in your tabelCell.</p> <p><strong>so your .h file looks like this.</strong></p> <p>//--------START------->></p> <pre><code>#import &lt;UIKit/UIKit.h&gt; @interface CustomCell : UITableViewCell{ UIButton *btn1; UIButton *btn2; UIButton *btn3; } @property(nonatomic , retain) UIButton *btn1; @property(nonatomic , retain) UIButton *btn2; @property(nonatomic , retain) UIButton *btn3; @end </code></pre> <p>//-------END------- &lt;&lt;</p> <p><strong>and your .m file will look like this</strong></p> <p>//--------START------->></p> <pre><code> #import "CustomCell.h" @implementation CustomCell @synthesize btn1, btn2, btn3; - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { //----frame the components as per your project req.---- btn1 = [[UIButton alloc] initWithFrame:CGRectMake(1, 1, 85, 70)]; [self.contentView addSubview:btn1]; btn2 = [[UIButton alloc] initWithFrame:CGRectMake(100, 1, 85, 70)]; [self.contentView addSubview:btn2]; btn3 = [[UIButton alloc] initWithFrame:CGRectMake(195,1, 85, 70)]; [self.contentView addSubview:btn3]; } return self; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } </code></pre> <p>//--------END-------&lt;&lt;</p> <p>Now you are ready to reuse this custom cell in your other classes. and also can modify them as per requirement.</p> <p><strong>Now in cellForRowAtIndexPath >></strong></p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; { static NSString *CellIdentifier = @"Cell"; CustomCell *cell = (CustomCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[CustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] ; } [cell.btN1 setImage:[UIImage imageNamed:@"YOUR IMAGE NAME"] forState:UIControlStateNormal]; // YOU CAN MAKE CHANGES HERE. ................// remaining logic goes here return cell; } </code></pre> <p>HOPE THIS WILL HELP YOU.</p> <p><a href="http://jainmarket.blogspot.in/2009/05/creating-custom-table-view-cell.html" rel="nofollow">1 .Also take a look on link tutorial.</a></p> <p><a href="https://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/TableView_iPhone/TableViewCells/TableViewCells.html" rel="nofollow">2. A Closer Look at Table View Cells</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload