Как заставить контент идти за каркас и покрыть весь экран?Android

Форум для тех, кто программирует под Android
Ответить Пред. темаСлед. тема
Anonymous
 Как заставить контент идти за каркас и покрыть весь экран?

Сообщение Anonymous »

Here is a screenshot of
application.
As you can see the green color is not covering the full screen but I want the green color cover the entire screen and the menu bar should be transparent to see the green color (I want a blur effect).
Here is the code:

Код: Выделить всё

    @composable
fun BlurredBottomBar(selectedItemIndex: Int, onItemSelected: (Int) -> Unit) {
val iconList = IconLists()
var itemList = iconList.itemList
var selectedItemList = iconList.selectedItemList
Box(
modifier = Modifier
.padding(top = 0.dp, start =  10.dp, end =  10.dp, bottom = 20.dp)
.fillMaxWidth()
.graphicsLayer(shadowElevation = 50f, shape = RoundedCornerShape(50.dp), clip = true)
.background(
Color.Black.copy(0.09f)
)
) {
Row(
modifier = Modifier
.height(60.dp)
.padding(10.dp)
.fillMaxWidth(),
verticalAlignment = Alignment.Bottom,
horizontalArrangement = Arrangement.SpaceBetween
) {
itemList.forEachIndexed { index, icon ->
var iconResId =
if (index == selectedItemIndex) selectedItemList[index] else itemList[index]
IconButton(
modifier = if(selectedItemIndex == index) Modifier.background(
Color.White.copy(alpha = 0.25f),
shape = CircleShape
) else {
Modifier
},
onClick = { onItemSelected(index) }) {
Icon(
painter = painterResource(id = iconResId),
contentDescription = "",
modifier = Modifier.size(25.dp),
)
}
}
}
}
}
< /code>
и в основной деятельности: < /p>
    @Composable
fun MainMethod() {
var selectedItemIndex by remember { mutableStateOf(0) }

Scaffold(
modifier = Modifier.fillMaxSize().background(Color.Transparent),
bottomBar = { BlurredBottomBar(selectedItemIndex,onItemSelected = { selectedItemIndex = it })},
content = {
Box(modifier = Modifier.padding(it).background(color = Color.Green).fillMaxSize())
{
Text("Main Content")
}
}
)

}
Помогите мне !!!


Подробнее здесь: https://stackoverflow.com/questions/796 ... ire-screen
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Android»