objective c - iOS - Custom table cell not full width of UITableView -
i may going wrong. have created uitableview has auto-layout trailing space set main view. creating custom cell table drug on prototype cell, customized it, , created class it. working fine.
what can't seem solve custom cell isn't going full width of actual table cell white background shows up. if don't use custom cell entire width table cell gets utilized.
i set constraints cell content background image should fill cell.
what doing wrong? let me know need solve this.
profilecustomcell.h
#import <uikit/uikit.h> @interface profilecustomcell : uitableviewcell { } @property (nonatomic, strong) iboutlet uilabel *namelabel; @property (nonatomic, strong) iboutlet uiimageview *profileimageview; @end
profilecustomcell.m
#import "profilecustomcell.h" @implementation profilecustomcell - (id)initwithstyle:(uitableviewcellstyle)style reuseidentifier:(nsstring *)reuseidentifier { self = [super initwithstyle:style reuseidentifier:reuseidentifier]; if (self) { self.namelabel.text = nil; } return self; } - (void)setselected:(bool)selected animated:(bool)animated { [super setselected:selected animated:animated]; } @end
uitableview
[tableview registernib:[uinib nibwithnibname:@"profilecustomcell" bundle:[nsbundle mainbundle]] forcellreuseidentifier:@"cell"]; [tableview setseparatorstyle:uitableviewcellseparatorstylenone]; profilecustomcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; cell.namelabel.text = [nsstring stringwithformat:@"%@", [child objectforkey:@"first_name"]]; [cell setselectionstyle:uitableviewcellselectionstylenone];
can post code please .
did enable use auto layout , use size classes below first in both table view , table view cell .and tell me problem
1)after select both image , label , below
2) select image , below
3) select label following
can check link below:
Comments
Post a Comment