简体   繁体   中英

how to auto align right hint in editText in hebrew?

I have two editText views.

Their hint is usually in english but it's translated to hebrew sometimes.

The problem is that one of their hints is aligned to left when translated and one of them is aligned to right when translated.

I cannot use android:alignment attribute

as in most of the world's region - the hint will be in english

and there the hint is aligned to left as desired.

how can i promise both hints will be aligned to right when using hebrew

and be aligned to left when using english?

Update

after a quick check I see the alignment is messed because of this:

    mInputText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
    mInputText.setTypeface(ResManager.getRobotoLight(mContext));

i wanted to re-set alignment using:

mPasswordField.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START);

but it's API 17 and I can use API 8 at most

try on the edit text

android:textAlignment = "viewStart"

also the hit on the edit text is influenced by the inner padding of the edit text

the hint should be aligned according to the locale of the app

android:textAlignment = "viewStart"

Had the same issue now working fine :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM