I have an app where I have UITextField
.
My app is English - Arabic app.
Now what I have is as below.
addPostVideoURL.backgroundColor = [UIColor clearColor];
addPostVideoURL.textAlignment = NSTextAlignmentNatural; <-- Setting alignment
addPostVideoURL.textColor = pGray_343434;
addPostVideoURL.placeholder = localize(@"videoURL");
[addPostVideoURL setValue:pGray_343434 forKeyPath:@"_placeholderLabel.textColor"];
addPostVideoURL.font = [self adjustDefaultFont:40];
addPostVideoURL.autocorrectionType = UITextAutocorrectionTypeNo;
If you see, I have set the Alignment text as NSTextAlignmentNatural
. I did this because if keyboard is arabic (& my app is english or arabic), I want textfield to start from right side.
With this when I changed the keyboard to English, text field start from LTR & if I change keyboard to arabic, textfield start from RTL. However, the placeholder that I have is always at the left.
Any way how can I make placeholder alignment based on the app language?