how to slide UILabel in uitableviewcell when swipe to delete is used
I have a custom uitableview with a UILabel to the right of the cell as shown below
I have enabled swipe to delete, but when the button appears the UILabel is covered, I am guessing this is because my custom tableviewcell has not been informed about the delete button..
I am wondering how I go about moving the UILabel to the开发者_运维问答 left of the delete button when the swipe is detected.
This is how you would do it if you create the cell in a xib. You create a view the same size as the cell and put all of your labels inside it. Create an outlet for this view. Then in the .m of the customCell you add the view to the contentView.
[[self contentView] addSubview:cellView];
Then, in the xib add struts so that the labels stick to the edge of whatever side they are nearest and you should be good to go!
精彩评论