android - paddingStart/Left and paddingEnd/Right -
in recent code writing times i've seen single element contain paddingleft/right, paddingstart/end, , both.
can't seem find on better , why. have insight / when use 1 or other or both?
you need new start/end properties create nice right-to-left layout, used in countrys people read right left.
there no better version, newer version.
if want support android versions prior android 4.2, should use old , new properties together. if want support android 4.2 , newer versions, it's ok use new properties paddingstart
(instead of paddingleft
).
there nice explanation available on android developers blog:
to take advantage of rtl layout mirroring, make following changes app:
declare in app manifest app supports rtl mirroring.
- specifically, add
android:supportsrtl="true"
element in manifest file.change of app's "left/right" layout properties new "start/end" equivalents.
if targeting app android 4.2 (the app's
targetsdkversion
orminsdkversion
17 or higher), should use “start” , “end” instead of “left” , “right”. example, android:paddingleft should become android:paddingstart.if want app work versions earlier android 4.2 (the app's targetsdkversion or minsdkversion 16 or less), should add “start” , end” in addition “left” , “right”. example, you’d use both
android:paddingleft
,android:paddingstart
.
Comments
Post a Comment