0

they say a picture is worth thousand words so... when i dont implement layoutSubviews in custom UITableViewCell i get this

enter image description here

after implementing layoutSubviews in custom UITableViewCell i get this

enter image description here

How can i get the first picture with the implementation of layoutSubviews?

liv a
  • 3,232
  • 6
  • 35
  • 76
  • While Timothy's answer is one likely issue, post your relevant code so people can actually provide concrete answers to your problem. – rmaddy Mar 03 '14 at 16:04
  • @rmaddy all the relevant information is in the question!!! just by overriding the layoutsubviews method the problem occurred. – liv a Mar 03 '14 at 17:45
  • No, the relevant info would be to show your implementation of `layoutSubviews`. The answer you accepted was a guess that turned out to be correct. If that hadn't been the case, then the only way people could have helped would have been if you had shown the relevant code. Something to consider for your next question. Enjoy. – rmaddy Mar 03 '14 at 17:50
  • @rmaddy im sorry but you are wrong since there is no code! sure i could have written `-(void) layoutSubviews {}` but i don't see how that would help. @Timothy Moose was not guessing he was just right! – liv a Mar 03 '14 at 18:02
  • Of course he was guessing. Since you didn't post your implementation of your `layoutSubview`, the problem could have been any number of things. So he guessed one likely (and common) possibility. No one but you knew for sure how you implemented `layoutSubview`. You could have had 100s of lines of code with one little mistake. So yes, it would have been very relevant for you to post your `layoutSubviews`. Of course this whole discussion is moot since you got your answer in this case. But next time, post the code to avoid any confusion. – rmaddy Mar 03 '14 at 18:09
  • @rmaddy instead of going back an forth maybe you can help me with another issue, when clicking on the pencil the textField iz1 becomes editable and i wish to dismiss the keyboard(`resignFirstResponder`) when clicking anywhere BUT on that cell (i.e. on iz 2 or any "empty" rows) can you help? – liv a Mar 03 '14 at 18:18
  • If you have a new question you should post another question (with relevant code). – rmaddy Mar 03 '14 at 18:21

1 Answers1

0

Don't forget to call super:

- (void)layoutSubviews
{
    [super layoutSubviews];

    //... custom stuff
}
Timothy Moose
  • 9,895
  • 3
  • 33
  • 44
  • Thanks this works, but there is still a wired behavior, when i delete rows, the row is deleted but it's space is remain although i perform [self.tableView reloadData] (in the picture above if deleted row 1: iz1 then iz 2 should appear where iz1 is but it remains in it's place and in the place of iz 1 there is a blank) how can i fix this? – liv a Mar 08 '14 at 23:43
  • Please post a new question with details. – Timothy Moose Mar 09 '14 at 00:49