2011-10-24 29 views
0

“安达卢斯”自定义字体在UITableViewCell中不起作用。步骤如下:如何使“Andalus”自定义字体在UITableViewCell中不起作用?

  • 添加字体文件名“Andalus.ttf”使用NSLog(@"%@", [UIFont familyNames]); //它返回“安达卢斯”关键在app-Info.plist中

  • “由应用程序提供的字体”获取字体名使用

  • 设置字体名称:cell.textLabel.font = [UIFont fontWithName:@"Andalus" size:10];

    cell.detailTextLabel.font = [UIFont fontWithName:@"Andalus" size:10]; 
    

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath 

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 

但像 'حمل' 不会出现在同一字体的文本编辑一个字

我从sqlite

感谢得到使用UTF8数据你提前

回答

1

是否A ndalus有不止一种变体,例如安达卢斯强和安达卢斯锋利?如果是这种情况,您必须指定您希望使用的变体的名称。

检查数组由[UIFont fontNamesForFamilyName:@"Andalus"]

+0

谢谢你的回复。但事实并非如此。和[UIFont fontNamesForFamilyName:@“Andalus”]只是返回安达卢斯 – user807146

+0

http://stackoverflow.com/questions/3691567/custom-arabic-font-in-ios 这是我的问题与误解的答案。每个人都可以更清楚地回答问题,以及如何与ios应用程序集成。 – user807146