ios - UILabel on UITableViewCell does not appear correctly -
ios - UILabel on UITableViewCell does not appear correctly -
i have interface configured using constraints in interface builder. set shown: http://imgur.com/a/xqa7d.
when cell rendered, right hand label not appear (but space remains): http://imgur.com/xwbssmd.
the cell in question custom uitableviewcell subclass:
#import <uikit/uikit.h> @interface progresscell : uitableviewcell @property (weak, nonatomic) iboutlet uilabel *textlabel; @property (weak, nonatomic) iboutlet uiprogressview *progressview; @property (weak, nonatomic) iboutlet uilabel *detailtextlabel; @end
there no farther logic on class.
the table view cell instantiated identifier have set on storyboard:
- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"progresscell"; progresscell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier forindexpath:indexpath]; object *room = [self.rooms objectatindex:indexpath.row]; cell.textlabel.text = room.name; cell.progressview.progress = 1.0f - ((float)room.avail)/room.total; cell.detailtextlabel.text = [nsstring stringwithformat:@"%d/%d", room.avail, room.total]; homecoming cell; }
if set breakpoint @ end of function , po [[cell detailtextlabel] text]
, text set correctly. label not hidden.
i @ loss possible cause. triggering behaviour?
other things i've tried:
renaming property other detailtextlabel (in case of possible clash) not work if add together 3rd label, default text, shows correctly if add together 3rd label , connect outlet in ib 1 not appear, default text problem label appears, 3rd label hiddenedit:
if log ultimate position of frame in question, sits @ {{0, 44}, {0, 0}}
.
things can seek find out whats happening:
put reddish background on label.
do nslog
label's frame , cell's contentview frame.
put hardcoded text on it. cell.detailtextlabel.text = @"hi";
ios objective-c interface-builder
Comments
Post a Comment