I am tiring to remove the underline of TabRow
, but did not succeed. Here is the code:
@ExperimentalPagerApi
@Composable
fun Tabs(pagerState: PagerState) {
val tabs = listOf(R.string.add, R.string.add)
val scope = rememberCoroutineScope()
val currentPage = pagerState.currentPage
TabRow(
modifier = Modifier
.padding(start = 36.dp, top = 16.dp, end = 36.dp)
.clip(shape = RoundedCornerShape(16.dp)),
selectedTabIndex = currentPage,
backgroundColor = Color.Transparent,
tabs = {
tabs.forEachIndexed { index, tab ->
Tab(
modifier = Modifier.clip(RoundedCornerShape(16.dp)),
text = {
Text(text = stringResource(id = tab))
},
selected = currentPage == index,
onClick = {
scope.launch {
pagerState.animateScrollToPage(index)
}
}
)
}
}
)
}
I only want to have the selected color.
set divider param of TabRow
as divider={}
. Default one is
divider: @Composable () -> Unit = @Composable {
Divider()
}