.requiredWidth(30.dp)
Box(modifier = Modifier.background(Color.LightGray).fillMaxWidth()) {ScrollableTabRow(selectedTabIndex = selectedTabIndex, // 默认选中第一个标签containerColor = ColorPageBg,edgePadding = 1.dp, // 内容与边缘的距离indicator = { tabPositions ->TabRowDefaults.SecondaryIndicator(Modifier.tabIndicatorOffset(tabPositions[selectedTabIndex]).requiredWidth(30.dp).clip(RoundedCornerShape(15.dp)))},divider = {}) {// 生成标签for (i in 0..10) {Tab(text = { Text("标签 $i 标签标签标签标签") },selected = i == selectedTabIndex, // 标签是否被选中onClick = {selectedTabIndex = i},selectedContentColor = Color.Blue, // 选中状态下的文字颜色unselectedContentColor = Color.Gray, // 未选中状态下的文字颜色)}}}