Right to Left Alignment for UITableView

后端 未结 2 779
长情又很酷
长情又很酷 2021-01-23 03:01

I am working on an arabic app for iphone 3.0. i was wondering if there is a way that i can convert the UITableViewCell to be right-to-left. I want everything to be in the opposi

相关标签:
2条回答
  • 2021-01-23 03:37

    Creating your own UITableViewCell subclass is not that hard to do and is probably the first thing you'll want to do to get a custom look. All you'll need is a custom XIB file and a bit of modified code in your cellForRowAtIndexPath function:

    NSString *CellIdentifier = @"IndividualContractWithResult";
    UITableViewCell *cell;
    
    ...
    
    cell = [thisTableView dequeueReusableCellWithIdentifier:CellIdentifier];
    
    if (cell == nil)
    {
        // TODO: improve code by avoiding the view controller creation
        UIViewController *vc = [[UIViewController alloc] initWithNibName:@"IndividualContractWithResult" bundle:nil];
        cell = (IndividualContractWithResult_Cell *) vc.view;
        [vc release];
    }
    
    0 讨论(0)
  • 2021-01-23 03:41

    Hmm.. It's really interesting) I have no solution, but few suggestions. First of all, you can try to use CGAffineTransformInvert to mirror your table. If it wil be useless, you can customize your tableView cells(make an UIImageView at the left side and UILabel with UITextAlignmentRight at the right). This is about your table. If you want to go to another view, you can just change your table view with UIViewAnimationTransitionFlipFromLeft animation instead of using UINavigationController. It's not a pretty solution, but it may do the trick) Good luck)

    0 讨论(0)
提交回复
热议问题