when i started to add the code in, it started to give me the problem I mention above. I thinking, is it because of the reusable cell problem?.
Help pls.
I dont see any code where you are changing hte height of the cell. Note that you should be using the heightForRowAtIndexPath method if you arent.
For the height of the cell I changed it in the .xib file.
I know I can use heightForRowAtIndexPath
If I use heightForRowAtIndexPath the return part will be like this
Your "colorValueRect" goes way beyond a height of 55. You have it start at 60 with a height of 30, so the bottom will draw at 90, which will overlap the next cell by 45. If you are using a cellHeight of 55, everything must fit in that height.
Your "colorValueRect" goes way beyond a height of 55. You have it start at 60 with a height of 30, so the bottom will draw at 90, which will overlap the next cell by 45. If you are using a cellHeight of 55, everything must fit in that height.
I tried what you said but it still overlaps
this is the screen shot of what i say, the top three pictures are the one when i add the code i mentioned. the arrow beside means scrolling up or down. when i run the program with the code it will show like the first picture. when i scroll down it will be like the second picture, the when i scroll up again. it will become like the third picture.
i want to make it like the fourth and fifth picture with the first three picture without this overlapping problem
Last edited by eagleclaws; 05-26-2011 at 08:36 PM.
I tried the code, works for the name but not for the picture.
by the way, can explain why do i need to put "nameValue. tag = 200"?
work for the label and not for the image, because i haven't touched the code part for image, thinking that you would be able to do it after seen how to do for labels
I think that you miss how work the code you wrote, what happen is that when you scroll uitableview, cellForRowAtIndexPath is called for each new cell that you see, in that we use dequeueReusableCellWithIdentifier that try to re-use an old cell (this for performance reason), if so, you need to remove\change the old label and the old image (as you seen i removed it, but you can also just change its value). In order to have a reference to the old image or label, we use a tag, so that we can use viewWithTag:tag to retrieve a pointer to the view to remove\change (in this case 2 labels and image).
I hope now is clear, let me know if you are able to understand and make it works also for image....
work for the label and not for the image, because i haven't touched the code part for image, thinking that you would be able to do it after seen how to do for labels
I think that you miss how work the code you wrote, what happen is that when you scroll uitableview, cellForRowAtIndexPath is called for each new cell that you see, in that we use dequeueReusableCellWithIdentifier that try to re-use an old cell (this for performance reason), if so, you need to remove\change the old label and the old image (as you seen i removed it, but you can also just change its value). In order to have a reference to the old image or label, we use a tag, so that we can use viewWithTag:tag to retrieve a pointer to the view to remove\change (in this case 2 labels and image).
I hope now is clear, let me know if you are able to understand and make it works also for image....
thanks for the explanation, i will try it on monday and see how it goes