What is LinearLayoutCompat in appCompat v7?

前端 未结 1 610
不知归路
不知归路 2021-02-03 18:41

In the support library appCompat v7 of the Android platform, there is a android.support.v7.widget.LinearLayoutCompat class.

Does someone know why this class exist? The o

相关标签:
1条回答
  • 2021-02-03 19:13

    The class LinearLayout exists since API level 1, but some APIs were added after that, for example, setShowDividers introduced on API level 11.

    So in this case setShowDividers (and it's parameters) should be invoked using LinearLayoutCompat instead LinearLayout if you are targeting a platform with API level below 11.

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