Semantic UI RTL setup issue?
Fixed it , It's a simple mistake.
The code was missing this.
<html dir="rtl" lang="ar">
Changing to right to left RTL programmatically
I changed my app to right to left RTL by using this :
self.transform = CGAffineTransformMakeScale(-1.0, 1.0)
This flipped the view, then i flipped the objects in the view like this:
label.transform = CGAffineTransformMakeScale(-1.0, 1.0)
textField.transform = CGAffineTransformMakeScale(-1.0, 1.0)
image.transform = CGAffineTransformMakeScale(-1.0, 1.0)
This made my views RTL instead of changing all constraints or rebuild the app as RTL.
LTR To RTL Using same xib in objective c
You can do this by changing the semantics
self.anyView.semanticContentAttribute = .forceLeftToRight
OR
self.anyView.semanticContentAttribute = .forceRightToLeft
In objective-c
self.anyView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
Or
self.anyView.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft;
see also this demo : RTLDemo
iOS: Determine if device language is Right to Left (RTL)
In iOS 9 one can determine the current direction for each individual view.
if #available(iOS 9.0, *) {
if UIView.userInterfaceLayoutDirection(
for: myView.semanticContentAttribute) == .rightToLeft {
// The view is shown in right-to-left mode right now.
}
} else {
// Use the previous technique
if UIApplication.shared.userInterfaceLayoutDirection == .rightToLeft {
// The app is in right-to-left mode
}
}
This is the recommended way of determining the layout direction in iOS 9.
WWDC 2015 video New UIKit Support for International User Interfaces. After minute 31:20.
how to remove semanticContentAttribute when presenting a view controller
Do
UIView.appearance().semanticContentAttribute = .forceRightToLeft
self.present(eventController, animated: true, completion: nil)
and when you dismiss it do
if selectedLanguageId == "eng"{
UIView.appearance().semanticContentAttribute = .forceLeftToRight
}else{
UIView.appearance().semanticContentAttribute = .forceRightToLeft
}
Related Topics
Twitter Bootstrap - Full Width Navbar
Add Syntax Highlighting to .Less-Files in Netbeans
Ember.Js Router: How to Animate State Transitions
CSS Hover on a Div, But Not If Hover on His Children
Relative Parent, Absolute Positioning Vertically by Percentage
Div to Take Up Entire Remaining Width
CSS Box Shadow on Container Div Causes Scrollbars
CSS Label Text Right Below Input Element
What Safari-Specific Pure CSS Hacks Are Out There
Css3 Transition Only When Class Is Added, Not When Removed
Using Less, CSS3 Calc() Doesn't Work Correctly
Incremental Slides Do Not Work with a Two-Column Layout
Css3 Gradients to Reproduce an 'Inner Glow' Effect from Illustrator with Border-Radius Applied
Canvas VS. Webgl VS. CSS 3D -> Which to Choose
How to Override "::-Webkit-Scrollbar" CSS Rule and Make Scrollbar Visible Again