ios - UITableViewCell right detailTextLabel frame resizes after reloadData -
i have uitableview 1 right detail cell , scrolling disabled , height of table set 44 (same cell). cell displays data representing object of class a. when user taps cell, pushes new vc table pick new object of class a. when pop old vc , call reloaddata
in viewwillappear
, detailtextlabel.frame
changed , not visible.
so in log, first line initial call cellforrowatindexpath
(object 1), , displays correctly. second line after selecting object 2 (empty string detailtextlabel
). third line after selecting object 1 again, , detailtextlabel
working before, invisible.
2015-03-28 10:48:11.747 dojo[32523:5852510] detail text label: <uitableviewlabel: 0x15d5de470; frame = (463 12; 42 20); text = '1234'; opaque = no; autoresize = rm+bm; layer = <_uilabellayer: 0x17429a810>> 2015-03-28 10:48:20.374 dojo[32523:5852510] detail text label: <uitableviewlabel: 0x15d5de470; frame = (468.5 13; 36.5 19.5); text = ''; autoresize = rm+bm; layer = <_uilabellayer: 0x17429a810>> 2015-03-28 10:48:23.192 dojo[32523:5852510] detail text label: <uitableviewlabel: 0x15d5de470; frame = (505 13; 0 0); text = '1234'; autoresize = rm+bm; layer = <_uilabellayer: 0x17429a810>>
i have set table in storyboard proper reuse id , calling dequeuereusablecellwithidentifier
cell;
update: gist vc
update 2: can't upload whole project i've created demo project portion of real code (slightly modified dependencies) exhibits same problem.
after looking @ code, seems bug in apple's code. if use sizetofit after setting text (and there vehicle.number see), number appears, chevron disappears until push pop again; not way should work. can around enough passing single space text when there no vehicle.number instead of empty string. so,
[cell.detailtextlabel settext: vehicle.number ? : @" "];
instead of this,
[cell.detailtextlabel settext: vehicle.number ? : @""];
the numbers in log still behind; need push , pop again before see correct frames in logs, label , chevron both show correctly.
Comments
Post a Comment