I'm trying to get my UITableView to show cells with images placed on them (contained in a UIImageView overlaid). I'm wondering why when scrolling up and down, the images look like they're overlaid on top of one another.
What can I do in this case for the sake of memory management as well as to fix this issue?
Make sure that when you're dequeuing a reusable cell that you remove whatever image view was in the cell before you add the one for the current index path.
Alternatively, you can change the image property of the UIImageView.
Related
for some reason the label in my uitableviewcell changes position when I have an activity indicator or something like that load on the right.. is there anyway to stop this?
cell one is having the problem in this view
Cell one and two are having the issue in this view
what happens is that when I have something loading in the background I have a uiactivity indicator, once thats played the labels in my custom cells move over to the right. if there is no Disclosure Indicator then you will see in the second image cell two moves right over to the right.. but if there is a Disclosure Indicator it moves over only a little bit.. other wise the labels will load in the correct position, but as soon as some type of cell indicatory happens then it throws the labels out of alignment.
Check your label's autoresizingMask includes UIViewAutoresizingFlexibleLeftMargin. If you're creating cells from storyboard/nib file, go to XCode's Size Inspector view and change the Autosizing to look like this:
I'm trying to expand a UITableViewCell to fill the entire screen using CoreAnimation.
How can I animate a TableViewCell so that it looks like the cell is expanding to fill the entire screen?
I will then push another ViewController in the completion block of the animation (without the user noticing).
I don't think it's possible to take the actual cell and expand it to fill the screen, because the TableView is managing the cell and could respond rather poorly to the cell's size going crazy all of a sudden.
What I would do is make a 'copy' of the cell using your own class extending UIView, display the copy directly above the cell of the table view (let me know if you need details on that step or if you can figure it out yourself), and then animate that to fill the screen.
For tips using CoreAnimation and layers, go try google - there's a lot out there already on the subject.
I use tableView with custom cells and for cell drawing I use drawRect: method for scrolling performance. In edit mode when I move cells move and down sometimes some cells appear blank. And during scrolling also random cells start appear blank.Please look attached images. Can someone help to understand problem?
if you are using dequeueReusableCellForIdentifier then try removing that.
I mean to say alloc a new cell every time.
I am suggesting above based on assumption that your cell contains some heavy data which takes time in drawing. In this case if you reuse cell then it will take cell that goes out of visible screen and will paint draw new data in it.
If this doesn't help then please post some code showing how you are creating custom cell.
I have a subclassed UITableViewCell that adds an image to the contentView, as well as two custom UILabels. When the table goes into editing mode everything shifts to the right correctly, but if I click on the delete control it nudges the frame of the image (which uses its own variable 'thumbnail') to the left. The labels stay in place, even though they're also subviews of contentView - so the image frame is being redrawn and contentView and the label frames are not.
I've tried overriding layoutSubviews but that doesn't seem to help, or I'm not doing it in the right way.
Does anyone know how to ensure contentView is treated as a single object, and prevent its individual subviews being moved? I'm not using IB and would prefer to keep it that way.
Thanks!
I've got an array of buttons in a UITableViewCell.
I populated them all through the cellForRowAtIndexPath method, but my tableview gets sluggish even though I have released everything.
Should I be using a custom UITableViewCell to populate?
Any suggestions on how to make this as smooth as possible for the user would be great.
Screenshot below.
You could create a custom cell / custom view pair for this specific cell, where you can draw all yours buttons in drawRect:. However, this would essentially draw all your buttons as an image so you wouldn't be able to tap them, but I guess you can always create a UITapGestureRecognizer to your cell (you'd still have to figure out which button was pressed by examining x,y values).
Still, I don't see any point in adding your tag buttons inside a UITableViewCell. You could come up for an alternate design in your UI, i.e. a UIView presented on top of the table, or a modal controller maybe.