Stopping a text view from moving within a custom TableViewCell
I have a not-very custom TableViewCell, mainly so that the detailTextLabel is a text field (so it can be unpinched to reveal its possibly multiple lines). Which mostly works fine, but as I scroll the list around, occasionally, and (not to me) predictably, the detail text in some cells slides up to the top of the cell, so that it obscures the textLabel. (It also sometimes grows in height so that the bottom goes beyond the bottom of the cell, which isn't a problem visually but might give a hint as to the problem). Sometimes, with more scrolling, the detail text slides back into its proper position.
This seems much more likely to occur after one or more cells have been (un)pinched; the code for handling pinches doesn't directly reference the detail text, just modifies the height of the row. And I don't recall ever seeing the row being (un)pinched having this problem.
Any ideas as to where I might even start look开发者_高级运维ing for the cause of this behavior would be greatly appreciated.
try using
[textView setUserInteractionEnabled:NO];
This will stop scrolling sine user won't be able to scroll.
Alternatively, you can try using the Label.
YourLabel.numberOfLines=10;
Hope that works for you.
精彩评论