I have built a storyboard as a RTL layout in consideration for use in a single language(hebrew),
Now i need to add an english option but the autolayout is mirroring in opposite as natively the storyboard is LTR,
In sum, i have an RTL on a LTR storyboard and i can't find a way to change the storyboard setting from the default LTR to RTL so that the auto mirroring will match the languages,
The language in my info.plist is set to "he",
I have edited the project files so the development language is hebrew,
Is there any way to fix the situation without re-building all the story board?
Thanks,
Related
I'm trying to have the launchScreen.storyboard to change according to the language of the device.
I made storyboards with each one having a different background color for UIImageView at the top see sample...
these storyboards are localized versions of the storyboard, so each one would be chosen according to the language of the device
the problem is :-
it always shows the english version for example when I switch the language of the iPhone's Simulator to Arabic, how can I make each one show up for the language it's localized for?
Unfortunatelly, you won't be able to achieve this. Launch screens are static and it's content is not a subject to localization.
Refering to the Apple human interface guidelines
Avoid including text on your launch screen. Because launch screens are static, any displayed text won’t be localized.
This piece of storyboard was intended to save you from creating a separate launch image for each screen resolution. iOS doesn't translate launch screen storyboards as it didn't give you a way to provide launch image for each of the supported languages.
However, you can find some workaround in this post.
Just to be sure, have you set support for those languages in Project settings(under Localizations) ?
I want to test my iOS app in right-to-left layout on device. When I set "Edit Scheme > Application Language > Right-To-Left Pseudo Language" in Xcode and run on device, the layout is flipped to RTL. However, if I leave "System language" in Xcode and then change the system language to Hebrew in iPhone settings (General > Language and region > iPhone language > Hebrew) my app is not displayed in RTL mode (all other apps do).
Why isn't my app layout changed to RTL when I change the iPhone's language to Hebrew?
I'm using Xcode 8.3.
I found what the problem was. I needed to add the Hebrew language internationalization in Project > Info section. After I re-ran on device, all layout appeared flipped (that is, in the right-to-left layout).
If it is text alignment please try the following
First try getting layout direction by
if ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute:view.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft) {
}
Then set the text alignment as follows.
enter code here
[[(NSMutableParagraphStyle *)paraStyle setAlignment:NSNaturalTextAlignment];
I am working on VOIP application. My base storyboard is in english language. I used multiplier constraint for leading, trailing, height, width, top, bottom.... for all so that UI can work for all devices according to their screen size.
It is working for the english but I have to convert it for Persian(Iran) language as well. I added Persian Storyboard by clicking on Localization and converted all the text in Persian. When I changed my device language english to Persian and launch the app text changed according to device language but UI layout not displaying properly due to multiplier constraint.
Layout in english language:
Layout in persian language:
And it spoils entire UI when I change the device language to Persian.
this is the way how i am giving constraint
So please help me how I can set the UI layout if language is R to L (Persian)
As I say in the title, I have a storyboard where I only use Auto Layout. It was developed for iOS 7 Deployment Target and now I'd like to make some updates and set it to iOS 8. I currently handle devices orientation changes in UI and different iPhone screen sizes by setting the alternative NSLayoutConstraint in each scene's UIViewController implementation, which was a pain... as far as I know, taking advantage of Size Classes makes this much easier.
I have quite a lot of scenes in my storyboard, so before enabling Size Classes I'd want to know if I'd be able to keep a "mix": I mean, if I enable Size Classes in the storyboard, will I have to use it in all its scenes? Or could I keep them the way they currently are, and then start doing partial migrations without "breaking" the app?
Another final question: is there something upcoming in iOS 9 regarding this that would be recommended right now to be taken into account?
Thanks
This shouldn't present any issues, however version control is your best friend for situations like this. I would make a branch in your git repo and test first if you're not convinced.
Size classes works with auto layout. Think of it as though your current story board only supports one device family that all constraints are managed through. When enabling size classes for the story board it now supports multiple device families for constraint management.
When you enable size classes for your story board all constraints will default to the device family of any size and any width (which could be thought of as device family all). You can then go about refactoring existing logic in your code to be managed by size classes in you story board by adding new, and altering existing constraints in interface builder for additional device families, then removing the redundant code. An example of an additional device family could be regular width and compact height (which is currently an iPhone 6 plus only).
I've heard arguments on localizing a StoryBoard file (the way apple recommends - might) not be a good idea. The recommended way is to highlight storyboard in the project navigation and then localize it by clicking a language in the file inspector.
Here is the other way suggested: Remove all strings from the storyboard and in the ViewController file itself load the localized Strings per UI element. The argument for this is that multiple storyboard files are created per localization and the UI constraints are sometimes not kept. You end up with localized storyboards that have different UI constraints. Thus the storyboards are not identical in layout. Can anyone verify if this is the case?
I have a task to localize a few storyboards and want to know all your ideas and best approach ? BTW not all my layouts that i have inherited from other developers are auto-layout.
It seems in the previous version of xcode below xcode 6 it duplicates storyboards when localizing them. In the newer version of xcode it does not duplicate the storyboard. Instead it creates a text localization file and keeps just one storyboard. You can localize the storyboard the same way as you localize any file from the file inspector.