UITableView的从右到左对齐 [英] Right to Left Alignment for UITableView

查看:121
本文介绍了UITableView的从右到左对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为iphone 3.0开发阿拉伯语应用程序。
我想知道是否有一种方法可以将UITableViewCell转换为从右到左。
我希望一切都朝着相反的方向发展。
有什么想法吗?

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 opposite direction. Any thoughts?

推荐答案

创建自己的UITableViewCell子类并不难做,可能是你做的第一件事我想做一个自定义的外观。所有你需要的是一个自定义的XIB文件和你的cellForRowAtIndexPath函数中的一些修改过的代码:

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];
}

这篇关于UITableView的从右到左对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆