Skip to content
This repository has been archived by the owner on Jul 12, 2019. It is now read-only.

When swipe the label in the cell with xib it's offset of some pixel #10

Closed
Piero87 opened this issue Apr 18, 2013 · 2 comments
Closed

Comments

@Piero87
Copy link

Piero87 commented Apr 18, 2013

Hello, i have problem with your amazing project, i have a uitableviewcell xib with a uilabel in it, and a subclass of it, here the the snippet:

#import <UIKit/UIKit.h>
#import "MCSwipeTableViewCell.h"

@interface ListViewCell : MCSwipeTableViewCell

@property (weak, nonatomic) IBOutlet UILabel *listName;
@property (weak, nonatomic) IBOutlet UIImageView *selectImg;

@end

and then in the .m file there is nothing, then i use your project in this way:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"ListCell";

ListViewCell *cell = (ListViewCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil)
{
      NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"ListViewCell_iPhone" owner:self options:nil];
        cell = [nib objectAtIndex:0];
}

[cell setDelegate:self];

[cell setFirstStateIconName:@"check.png"
                 firstColor:[UIColor colorWithRed:85.0/255.0 green:213.0/255.0 blue:80.0/255.0 alpha:0.0]
        secondStateIconName:nil
                secondColor:nil
              thirdIconName:@"cross.png"
                 thirdColor:[UIColor colorWithRed:232.0/255.0 green:61.0/255.0 blue:14.0/255.0 alpha:0.0]
             fourthIconName:nil
                fourthColor:nil];

cell.listName.text = [[self.list objectAtIndex:indexPath.row] name];

[cell setMode:MCSwipeTableViewCellModeSwitch];

return cell;
}

now, the problem is this, when i swipe on the cell, and i release it, the label in cell it's offset on the left of some pixel, then, when i click on the row it return at the normal position, how i can solve this problem?

@alikaragoz
Copy link
Owner

I think this is related to the fact that you are using auto-layout in your xib. Unfortunately this lib isn't auto-layout compatible so you'll need to desactive it on your xib.

@l4u
Copy link

l4u commented May 16, 2013

This might be related to accessory type

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants