Skip to content

Instantly share code, notes, and snippets.

@tw-Frey
Created June 29, 2022 04:10
Show Gist options
  • Select an option

  • Save tw-Frey/35a6ff09884d1df2b531d2ad1f5b714c to your computer and use it in GitHub Desktop.

Select an option

Save tw-Frey/35a6ff09884d1df2b531d2ad1f5b714c to your computer and use it in GitHub Desktop.
Unified layout margins and padding

Android 8.0 (API level 26) makes it easier for you to specify situations where opposite sides of a View element use the same margin or padding. Specifically, you can now use the following attributes in your layout XML files:

image

But

image

參考 https://developer.android.com/about/versions/oreo/android-8.0#ulmp https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/tools/aapt2/#version-2_16 [paddingBottom]:https://developer.android.com/reference/android/R.attr#paddingBottom [paddingLeft]:https://developer.android.com/reference/android/R.attr#paddingLeft [paddingRight]:https://developer.android.com/reference/android/R.attr#paddingRight

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment