将UITableView转换为支持从右到左的语言 [英] transforming UITableView to support right to left languages

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

问题描述

我有一个 UITableView ,我想对其应用一些转换,因此它将支持从右到左的语言,我做的是以下:

  for(UITableViewCell * cell in self.RSSNewsTableView.visibleCells){
cell.transform = CGAffineTransformMakeRotation(180 * 0.0174532925);
cell.textLabel.transform = CGAffineTransformMakeRotation(180 * 0.0174532925);
cell.detailTextLabel.transform = CGAffineTransformMakeRotation(-M_PI);
cell.textLabel.textAlignment = UITextAlignmentRight;
// cell.transform = CGAuffineTransformMakeRotation(2 * M_PI);

}

我得到的是以下内容:





detailTextLabel 的正确转换是什么,因此它将被正确放置在单元格的 textLabel 下?

解决方案

我个人不会实现一个仿射变换,只需创建新的标签和自定义视图,



我用阿拉伯语言看了我的iPhone,默认导航仍然在左边,所以没有必要在你的屏幕截图中打开绿色披露指示器。 / p>

I have a UITableView, I want to apply some transformation on it so it will support right to left languages, what I did is the following:

       for(UITableViewCell *cell in self.RSSNewsTableView.visibleCells) {
        cell.transform = CGAffineTransformMakeRotation(180*0.0174532925);
        cell.textLabel.transform = CGAffineTransformMakeRotation(180*0.0174532925);       
        cell.detailTextLabel.transform = CGAffineTransformMakeRotation(-M_PI);             
        cell.textLabel.textAlignment = UITextAlignmentRight;
       // cell.transform = CGAffineTransformMakeRotation(2*M_PI);

    }

and what I got is the following:

what is the right transformation for the detailTextLabel so it will be placed correctly under cell's textLabel ?

解决方案

i personally would not implement that with a affine transformation, just create new labels and custom views and position them yourself with the autoresizingmask

i looked at my iPhone with the arabic language and the default navigation still goes to the left, so there is no need to turn the green disclosure indicator in your screenshot.

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

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