Comments (6)
According to my experiments for tracing the issue, it seems that UIKeyInput components alignment does not get affected by semanticContentAttribute
. Note that not all components with textAlignment
have this issue since the UILabel responds to semanticContentAttribute
effect iff its textAlignment
is natural
, however even if the textAlignment
for a UIKeyInput is natural
it won't change its alignment.
In general, there are similar issues related to this one, for instance: Skyscanner/SkyFloatingLabelTextField#109.
So far, we have to explicitly change textAlignment
for the UIKeyInput
components.
@MoathOthman please advice.
from molh.
Ok, so let's split the issue to make it more clear.
For the text field:
At some point we could change the alignment of the placeholder itself and enforce the text alignment to be the desired one, regardless of what's the used language.
For the text view:
obviously, there is no placeholder by default. I assume that the fix should be to enforce it to the desired text alignment...
from molh.
from molh.
@AhmadFayyas thank you for your insights , that seems legit since the the direction of the text should depends on the direction of the user input , yet what we are trying to solve here is a bit different since we just need to make the placeholder alignment looks the same as with the other components.(my bad wrong acceptance criteria, will fix it @AhmadFayyas )
currently its applied to the uitextField, but its not perfect though .
for subview in self.subviews {
if let label = subview as? UILabel {
label.tag = self.tag
}
}
the issue with the above code is that it will change the direction once the user start editing to the wrong direction ,
we have to explicitly change textAlignment for the UIKeyInput components
is that possible ? .
from molh.
I am facing the same issue.
When I switch the language to Arabic and I use English keyboard; the cursor will start from LTR instead of RTL. However, it will start from RTL when I change my keyboard language to Arabic. Any solution to fix that?
I found a solution but it will be a repeating code for every view in the storyboard.
If the app is Arabic, it will use the following code:
textfield.textAlignment = .right
If the app is English, it will use the following code:
textfield.textAlignment = .left
Any chance to use a function that will update all the textfields and textviews alignment in the application after changing the language?
from molh.
@alielephant its tricky one , if you have a fix please don't hesitate to submit a pr.
from molh.
Related Issues (20)
- application restart not working as well HOT 10
- Label's font doesn't change with language (Localization) HOT 1
- App Getting Crashed for iOS 13 HOT 9
- Language of UIActivityViewController Does not change when Reset HOT 16
- Kurdish language corrupted text HOT 14
- Canβt embed molh in objective c project HOT 1
- images flip even I forced it to LTR
- Not work fine with Zendesk Chat HOT 7
- reset func not work in version 1.3 HOT 6
- set Default Language to Arabic not working right on first run HOT 19
- Language not changed on camera icons and toolbar
- when change language to Urdu or Arabic and run app , texts font changed to this font HOT 1
- after update xcode and swift version HOT 16
- UIDatePicker & UISearchBar not changing language after reset HOT 3
- i have to close and open app to make view flipped case arabic language is ok but view still not flipped on first time run HOT 1
- Apple pay button text is not localised when we change the language from app but when app is restarted it works fine
- numbers language does not change after localization till restarting the app HOT 4
- App Crash Randomly HOT 3
- Regressed crash in MOLH file HOT 2
- Back button direction wrong
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from molh.