Does Semantic UI Framework Support Rtl Languages

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



Leave a reply



Submit