Hi guys, I have a problem regarding the view in sm...
# compose
k
Hi guys, I have a problem regarding the view in smaller device. The text inside
Row
is getting cut. Code in đź§µ
Copy code
@Composable
fun ScreenView(verticalScroll: ScrollState = rememberScrollState()){
    Column(
        modifier = Modifier
            .padding(16.dp)
            .fillMaxSize()
            .verticalScroll(verticalScroll),
    ) {
        Column(
            modifier = Modifier
                .fillMaxSize()
                .weight(1f),
            verticalArrangement = <http://Arrangement.Top|Arrangement.Top>,
            horizontalAlignment = Alignment.CenterHorizontally
        ) {
            Image(painter = abc, contentDescription =null )
            Text(text = "xyz")
        }
        Column {
            Spacer(modifier = Modifier.height(16.dp))
            Row(
                modifier = Modifier
                    .fillMaxWidth()
                    .wrapContentHeight()
                    .background(Color.Gray)
                    .padding(vertical = 10.dp, horizontal = 20.dp),
                horizontalArrangement = Arrangement.spacedBy(12.dp)
            ) {
                Image(painter = abc, contentDescription = null)
                Text(
                    text = "warningMessage warningMessage warningMessage warningMessage warningMessage warningMessage warningMessage warningMessage warningMessage warningMessage warningMessage warningMessage warningMessage",
                    style = SlateTypography.body2
                )
            }
        }
    }
}
My bottom view
Row
looks like this in bigger device
But when I tried for smaller device my
Row
view looks like this
How to solve this problem?
c
Have you tried inverting
.padding(16.dp)
and
.fillMaxSize()
on your root Column ?
k
Sorry what do you mean by inverting?
c
Putting first
.fillMaxSize()
and then
.padding(16.dp)
k
yes but no luck. Same issue still..
k
Is it each row that gets cut off, or just the final one?
k
The last one only
k
I wonder if your parent container might have the same problem @Christian Kula mentioned, with the modifiers in the wrong order…
And is it scrollable?
k
no it's not scrollable
I rewrite the code
Copy code
Column(
        modifier = Modifier
            .fillMaxSize()
            .padding(16.dp)            .verticalScroll(verticalScroll),
    ) {
but still same issue
k
Seeing more of your code might make it easier for people to help
k
sure, I'll add in here
z
You can control Text’s overflow behavior with the
overflow: TextOverflow
parameter.
k
(gotta love the answer coming from Zach with the sound “clip” in his name 🤣 )
z
That’s me, Zach “text-clippin’” Stein