Difference between an AppCompat view and a normal Android view

前端 未结 2 1615
青春惊慌失措
青春惊慌失措 2021-02-05 03:02

What is the difference between an AppCompat view component and a standard/default view component?

For example, the difference between an AppCompatEdit

相关标签:
2条回答
  • 2021-02-05 03:37

    What is the difference between an AppCompat view component and a standard/default view component?

    AppCompat View Component supports compatible features on older version of the platform.

    the AppCompat view components are described as "tint aware", but is this the only difference, and what exactly does this do?

    Although most of the AppCompatView only difference is it allows dynamic tint and background tint. Tint aware is not the only difference, each AppCompatView has its own differences, for example.

    • AppCompatEditText vs EditText

    Allows textAllCaps style attribute up to Gingerbread.

    • AppCompatSpinner vs Spinner

    Setting the popup theme using popupTheme.

    You can dig down each view difference in Android docs.

    However, as Sid / Docs says, you don't have to specify this on your layouts since it will automatically converted to AppCompat views. But, if you want to create custom view, you should use AppCompat Views, or else this bug will happens.

    0 讨论(0)
  • 2021-02-05 03:38

    When you are using a Button or an EditText you are actually using AppCompatButton and AppCompatEditText. From the official documentation of the AppCompatEditText.

    A tint aware EditText. This will automatically be used when you use EditText in your layouts. You should only need to manually use this class when writing custom views

    0 讨论(0)
提交回复
热议问题