ios - If a cell's detailTextLabel is empty how do I figure out where its right edge would be if it wasn't empty? -
i'm using table view form. when row tapped add text field cell (the cell value1 type) , user can edit contents of detailtextlabel. position text field spans distance right edge of textlabel right edge of detailtextlabel. set frame of text field on detailtextlabel except goes left far possible. visually it's nice--there no jitters when hiding/unhiding text field.
it looks (without green , red):
this works great when detailtextlabel has in it. when detailtextlabel empty frame not yet defined. if log in frame zero. don't have reference placing text field precisely on detailtextlabel be.
i start figuring things out right side of textlabel , go right until number of pixels right edge of cell. but, example, if there's info button there? nice thing using detailtextlabel reference it's right edge correctly placed cell.
any ideas?
you can put space (' ') instead of empty label. way not visible user, , still nice reference
Comments
Post a Comment