I'm looking for a way to change the reorder control image and size.
I've using this code to change the reorder image:
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
for (UIControl *control in cell.subviews)
{
if ([control isMemberOfClass:NSClassFromString(@"UITableViewCellReorderControl")] && [control.subviews count] > 0)
{
for (UIControl *someObj in control.subviews)
{
if ([someObj isMemberOfClass:[UIImageView class]])
{
UIImage *img = [UIImage imageNamed:@"btn_move.png"];
((UIImageView*)someObj).frame = CGRectMake(0, 0, 30, 24);
((UIImageView*)someObj).image = img;
}
}
}
}
}
This code works perfectly on iOS 6, but NOT on iOS 7.
How can i fix this? is there any other way to change the reorder control image?
Try
for(UIView* view in self.table.subviews)
{
if([[[view class] description] isEqualToString:@"UITableViewWrapperView"])
{
for(UIView* viewTwo in view.subviews) {
if([[[viewTwo class] description] isEqualToString:@"UITableViewCell"]) {
for(UIView* viewThree in viewTwo.subviews) {
if([[[viewThree class] description] isEqualToString:@"UITableViewCellScrollView"]) {
for(UIView* viewFour in viewThree.subviews) {
if([[[viewFour class] description] isEqualToString:@"UITableViewCellReorderControl"]) {
for(UIImageView* viewFive in viewFour.subviews) {
// your stuff here
}
}
}
}
}
}
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With