简体   繁体   中英

Jetpack Compose Circular Progress Indicator background color missing

I am trying to implement the circular progress indicator using jetpack compose (docs for reference Cirular Progress Indicator Docs ) in the docs they have mentioned the backgroundColor property, but inside the source code of CircularProgressIndicator this property is missing

循环进度指示器源代码图片

循环进度指示器源代码图片

I have the latest compose bom dependency and using material 2

    // https://developer.android.com/jetpack/compose/setup#setup-compose
    def composeBom = platform('androidx.compose:compose-bom:2023.01.00')
    implementation composeBom
    androidTestImplementation composeBom

    // COMPOSE UI
    implementation 'androidx.compose.ui:ui'

    // MATERIAL 2
    implementation 'androidx.compose.material:material'

Is this property missing?. how can i add a background color to the circular progress indicator

try this

CircularProgressIndicator(
        modifier = Modifier
        .background(Color.Blue)
        .padding(16.dp) // increase it as much you want to expand it's background area
)

    

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