Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
193 votes
19 answers
281k views

I'm creating a layout with Jetpack Compose and there is a column. I would like center items inside this column: Column(modifier = ExpandedWidth) { Text(text = item.title) Text(text = ...
mac229's user avatar
  • 5,039
74 votes
6 answers
104k views

Is it possible to do weights in Jetpack Compose? For example, I'd like to set it up in such a way that one item is weighted as 1/3 of a layout, and the other takes up the remaining 2/3. In the XML/...
Corey Waldon's user avatar
71 votes
6 answers
41k views

How to create vertical dividers with Jetpack Compose? I try to use Spacer and Box to do it, but it doesn't show up at all. Here is what i tried: Box( modifier = Modifier .fillMaxHeight() ...
wiryadev's user avatar
  • 1,529
56 votes
3 answers
38k views

I am trying to show two text messages besides each other in a row but when the size of the first text is big, the second view gets pushed out of the screen as shown below: The code: Row(modifier = ...
David Ibrahim's user avatar
53 votes
1 answer
14k views

Is it possible to combine Arrangement.spacedBy(16.dp) and Arrangement.Center in a Row.horizontalArrangement? What I would like to do is to center the content horizontally and also set a default ...
Roberto Leinardi's user avatar
48 votes
6 answers
56k views

I'm using the brand new Kotlin Compose for my view, I have a row with 2 items, how can I make them center-vertical-like? Row( modifier = Spacing(20.dp) ) { Text(text = &...
Kamran Akbary's user avatar
47 votes
1 answer
17k views

I try to achieve this layout but don't really know how: currently it looks like this: using this Code: @Preview(widthDp = 150) @Composable fun Item() { Card(shape = RoundedCornerShape(8.dp)) { ...
JacobZ's user avatar
  • 499
46 votes
4 answers
60k views

How to use Spacer filling between with two elements in a row, let one element at the start of row and another at the end? Row { Text("Start") Spacer(modifier = Modifier.SpaceBetween) ...
ccd's user avatar
  • 7,108
43 votes
5 answers
56k views

I have a Column with some rows, and I want to align the last row at the botton, but this row is never located at the bottom of the screen, it stays right after the previous row: Column { //...
Paul9999's user avatar
  • 1,031
37 votes
1 answer
25k views

I have a Row with max width, I want to place a Icon at start then a text and then another Icon at end. I have specific sizes of icon and I want the Text to fill up the remaining space. Row( ...
DelusionaL's user avatar
31 votes
5 answers
30k views

How can I align the text using Text composable function vertically. Is there a way to do it without having to add another extra view to contain the Text. The textAlign parameter of Text only has the ...
Dan Artillaga's user avatar
28 votes
2 answers
21k views

I am trying to scroll down to the position of a specific UI element on clicking a Text. The code for my Text is: Text( "What is autosaving?", ...
Sparsh Dutta's user avatar
  • 3,078
27 votes
4 answers
20k views

I have as an example the following Composable: @Composable fun CustomCanvas( ) { Box( Modifier .aspectRatio(1.33f) .fillMaxWidth()) } How do I know the size of this object ...
user3872620's user avatar
  • 1,634
16 votes
1 answer
12k views

I follow the official document to learn about Rows. It's working fine. It arrange views horizontally and application runs without any issues. Problem: I want to set horizontalArrangement in Row. It ...
Ranjithkumar's user avatar
  • 18.6k
16 votes
1 answer
27k views

I essentially want cards pinned to the top with a group of buttons pinned to the bottom (on screen keyboard) Using Column with a modifier like so only leads to the buttons covering the top cards: fun ...
Joe Pleavin's user avatar

15 30 50 per page
1
2 3 4 5