【发布时间】:2021-07-27 15:27:48
【问题描述】:
我想在点击时显示 CircularProgressIndicator 然后隐藏!函数执行时的 CircularProgressIndicator 请参见下面的代码
var loader by remember {mutableStateOf(false)}
if(loader){
CircularProgressIndicator()
}
Button (onclick {
loader = !loader // show CircularProgressIndicator
// Function which is to be executed
// After function is executed which usually takes 2 sec then after that CircularProgressIndicator should be hidden
loader = loader // Not hidding
}){
Text("Toggle")
}
【问题讨论】: