关于如何使用情节提要如何对带有静态单元格的UITableView的节标题进行本地化,我找不到任何内容。
我试图获取Table View Section的ID并定位其Header,但是它不起作用。从来没有接受我的本地化。
"eBi-dg-Pbw.header" = "my string";
"eBi-dg-Pbw.text" = "my string";
"eBi-dg-Pbw.title" = "my string";
我实现了- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
来本地化我的版面,但我想知道是否有一种使用情节提要进行本地化的方法。
谢谢!
答案 0 :(得分:0)
第一个选项-故事板.strings
文件中的名称错误。正确的是:
"eBi-dg-Pbw.headerTitle" = "This is the header localisation";
"eBi-dg-Pbw.footerTitle" = "This is the footer localisation";
第二个选项-您需要在Interface Builder的静态部分元素中为 Header 和 Footer 填充默认(虚拟)值。在您的屏幕截图中,仅在 Header 字段中填充了值“我的标题字符串”,并且 Footer 留空了
之后-您不再需要通过ViewController代码实现本地化