【问题标题】:setSemanticContentAttribute: not working in tvOS 10setSemanticContentAttribute:在 tvOS 10 中不起作用
【发布时间】:2017-04-26 12:07:37
【问题描述】:

在我的应用程序中,我将布局方向设置为从右到左,我的应用程序在 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];
    }
}

【问题讨论】:

    标签: ios objective-c tvos apple-tv tvos10


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-04
      • 2016-03-08
      • 2018-12-04
      • 2015-12-12
      相关资源
      最近更新 更多