What is the ButtonBarLayout and how should we use it?

后端 未结 7 1789
一向
一向 2021-02-03 19:57

When I developed, I found a new widget called android.support.v7.widget.ButtonBarLayout unexpectedly. I tried to search it on the internet, but nothing was found, e

7条回答
  •  旧时难觅i
    2021-02-03 20:03

    The source code describes ButtonBarLayout as follows:

    /**
     * An extension of LinearLayout that automatically switches to vertical
     * orientation when it can't fit its child views horizontally.
     */
    

    So, in essence, it is nothing but a smart LinearLayout which manages auto-switching orientations based on available space on screen.

    The same ButtonBarLayout.java file describes mAllowStacking in comments as follows:

    /** Whether the current configuration allows stacking. */
    

    Source Code Here

提交回复
热议问题