简体   繁体   中英

How do I disable the composable preview in Android Jetpack Compose?

I have several composables with a preview in my activity. they take a long time to render, and I only need to check one composable. How do I disable the composable preview in Android Jetpack Compose?

You could use the group attribute in the Preview.

Something like:

@Composable
@Preview(group="Test")
fun test1(){ }

Then in the Preview panel you can select the preview group:

在此处输入图像描述

In this way you can select the preview to be displayed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM