Class ViewGroup
Stay organized with collections
Save and categorize content based on your preferences.
A ViewGroup
is a visual grouping of views in the navigation pane.
Signature
export class ViewGroup
Details
Constructors
Methods
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-06-20 UTC.
[null,null,["Last updated 2025-06-20 UTC."],[],[],null,["# Class ViewGroup\n\nA `ViewGroup` is a visual grouping of views in the navigation pane.\n\nSignature\n---------\n\n export class ViewGroup\n\nDetails\n-------\n\n| Final | No |\n|-------|----|\n\nConstructors\n------------\n\n| Name | Description |\n|---------------------------------------------------------------|----------------------------------------------------|\n| [`(constructor)(viewOrId)`](./picker.viewgroup._constructor_) | Constructs a new instance of the `ViewGroup` class |\n\nMethods\n-------\n\n| Name | Description |\n|--------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|\n| [`addLabel(label)`](./picker.viewgroup.addlabel) | Add a label to this `ViewGroup`. |\n| [`addView(viewOrId)`](./picker.viewgroup.addview) | Add a view to the `ViewGroup`. The view can be represented by a view-derived object, or simply by `ViewId`. |\n| [`addViewGroup(viewGroup)`](./picker.viewgroup.addviewgroup) | Nest a `ViewGroup` within the current `ViewGroup`. |"]]