My app has to be in Arabic,so I set up the code :
[AppRTL isAppRTL]? ([UIView appearance].semanticContentAttribute = UISemanticContentAttributeForceRightToLeft):([UIView appearance].semanticContentAttribute = UISemanticContentAttributeForceLeftToRight);
[AppRTL isAppRTL]?( [UISearchBar appearance].semanticContentAttribute = UISemanticContentAttributeForceRightToLeft):([UISearchBar appearance].semanticContentAttribute = UISemanticContentAttributeForceLeftToRight);
[AppRTL isAppRTL]?([[UINavigationBar appearance] setSemanticContentAttribute:UISemanticContentAttributeForceRightToLeft]):([[UINavigationBar appearance] setSemanticContentAttribute:UISemanticContentAttributeForceLeftToRight]);
[AppRTL isAppRTL]?([[UITabBar appearance] setSemanticContentAttribute:UISemanticContentAttributeForceRightToLeft]):([[UITabBar appearance] setSemanticContentAttribute:UISemanticContentAttributeForceLeftToRight]);
and The UIlabel I set up textAlignment = NSTextAlignmentNatural;
But , English language text display is right-aligned rather than left-aligned,Arabic text appears on the right,which is correct.
What do I have to do to make it left-aligned in English and right-aligned in Arabic?
[AppRTL isAppRTL]? ([UIView appearance].semanticContentAttribute = UISemanticContentAttributeForceRightToLeft):([UIView appearance].semanticContentAttribute = UISemanticContentAttributeForceLeftToRight);
[AppRTL isAppRTL]?( [UISearchBar appearance].semanticContentAttribute = UISemanticContentAttributeForceRightToLeft):([UISearchBar appearance].semanticContentAttribute = UISemanticContentAttributeForceLeftToRight);
[AppRTL isAppRTL]?([[UINavigationBar appearance] setSemanticContentAttribute:UISemanticContentAttributeForceRightToLeft]):([[UINavigationBar appearance] setSemanticContentAttribute:UISemanticContentAttributeForceLeftToRight]);
[AppRTL isAppRTL]?([[UITabBar appearance] setSemanticContentAttribute:UISemanticContentAttributeForceRightToLeft]):([[UITabBar appearance] setSemanticContentAttribute:UISemanticContentAttributeForceLeftToRight]);
and The UIlabel I set up textAlignment = NSTextAlignmentNatural;
But , English language text display is right-aligned rather than left-aligned,Arabic text appears on the right,which is correct.
What do I have to do to make it left-aligned in English and right-aligned in Arabic?