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