UITableView 从右到左对齐 [英] Right to Left Alignment for UITableView
本文介绍了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屋!
查看全文