0

在我的应用程序中,我将布局方向设置为从右到左,我的应用程序在 tvOS 9 上运行良好,但是当我在 tvOS 10 上运行我的应用程序时,它以从左到右的布局方向运行。看起来操作系统忽略了 setSemanticContentAttribute。我正在使用以下代码。

if(IOS9) {
    [[UINavigationBar appearance] setSemanticContentAttribute:UISemanticContentAttributeForceLeftToRight];
    [[UITabBar appearance] setSemanticContentAttribute:UISemanticContentAttributeForceRightToLeft];
    if ([[[UIView alloc] init] respondsToSelector:@selector(setSemanticContentAttribute:)]) {
        [[UIView appearance] setSemanticContentAttribute:UISemanticContentAttributeForceRightToLeft];
        [[UILabel appearance] setSemanticContentAttribute:UISemanticContentAttributeForceRightToLeft];
        [[UITableView appearance] setSemanticContentAttribute:UISemanticContentAttributeForceRightToLeft];
        [[UICollectionView appearance] setSemanticContentAttribute:UISemanticContentAttributeForceRightToLeft];
        [[UIButton appearance] setSemanticContentAttribute:UISemanticContentAttributeForceRightToLeft];
    }
}else{
    if ([[[UIView alloc] init] respondsToSelector:@selector(setSemanticContentAttribute:)]) {
        [[UIView appearance] setSemanticContentAttribute:UISemanticContentAttributeForceRightToLeft];
    }
}
4

1 回答 1

0

在 tvOS 中将值 forceRightToLeft 设置为属性 semanticContentAttribute 没有任何效果。无论如何,视图都是从左到右添加的。

这是 tvOS 中的一个错误https://openradar.appspot.com/31138095

于 2017-04-26T18:26:12.567 回答