Tonnie
Tonnie

Reputation: 8102

Visualizing Component Tree in Jetpack Compose

In Android View System you can see the UI tree of different elements that make up the view hierachy for example as shown below:

enter image description here

Apart from Previewing the Composables, I am looking for a way to visualize the Composables in a Component Tree for example given this code:

    @Composable
    fun TodoScreen(....) {
    
    Column(){
    LazyColumn{
    
    ...}
    Row{
    
    Button(){....}
    Text(){...}
    
    }
    
    }
}

Please let me know if there is a way to display a Component Tree on Android Studio Arctic Fox similar to the above Android View Hierachy Image.

Upvotes: 4

Views: 2699

Answers (1)

Gabriele Mariotti
Gabriele Mariotti

Reputation: 363429

You can use View -> Tool Windows -> Layout Inspector

enter image description here

Upvotes: 8

Related Questions