2017-04-26 45 views
0

不工作在我的應用我設置佈局方向爲從右至左,我的應用程序工作在tvOS 9很好,但是當我跑我的tvOS 10應用程序在其運行左到右佈局方向。它看起來像OS無視setSemanticContentAttribute。我正在使用以下代碼。setSemanticContentAttribute:在tvOS 10

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]; 
    } 
} 

回答

0

將值forceRightToLeft設置爲tvOS中的屬性semanticContentAttribute沒有任何影響。無論如何,視圖都是從左到右添加的。

這是tvOS中的一個錯誤https://openradar.appspot.com/31138095