2

I have a requirement to only allow single-digit input, but the text appears partially cut off and I'd like to increase the size of the text area to display the entire digit.

I encountered this problem when I increased the fontSize value. However, I don't want the fontSize to be too small either. Here's the simplified version of the TextField;

val localWidth = LocalConfiguration.current.screenWidthDp.dp

TextField(
    value = text,
    onValueChange = {},
    modifier = Modifier.width(localWidth / 8),
    textStyle = TextStyle(
        color = GrayNormal,
        fontWeight = FontWeight.Bold,
        fontSize = 32.sp,
        textAlign = TextAlign.Center
    ),
)

I tried changing parameters like textAlign, but it didn't work. It currently looks like this:this is layout inspector

enter image description here

When I look at it in the layout inspector, the text part can be fully visible if it is at its widest. However, I couldn't find how to do it. Thank you.

0 Answers0