Vivek Sharma

    Vivek Sharma

    1 year ago
    Prev we used Modifier.align(SomeAlignment), I guess it is changed. how to align composable , specifically in Box? [SOLVED]
    d

    Denis

    1 year ago
    {horizontal,vertical}{Alignment,Arrangement} parameters
    Vivek Sharma

    Vivek Sharma

    1 year ago
    what I didnt get you
    d

    Denis

    1 year ago
    https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/package-summary#column don't verticalArrangement, horizontalAlignment parameters do what you want?
    Vivek Sharma

    Vivek Sharma

    1 year ago
    I dont want to align whole content, Box have params of contentAlignment, I want to align composable inside box, like I did in my prev project like Modifier.align()
    why only columns/rows have these params, if I want to align text or something 😅
    oh sorry textAlign is there, but I was tryingn something else, maybe I will try that thanks for the time
    d

    Denis

    1 year ago
    I've just tried Modifier.align in alpha12 and it works well. What is the problem you're experiencing?
    @Preview
    @Composable
    fun FPreview() {
        Box(Modifier.size(100.dp)) {
            Text("Hi, Vivek!", Modifier.align(Alignment.BottomCenter))
        }
    }
    Vivek Sharma

    Vivek Sharma

    1 year ago
    oh, I can not use Modifier.align(), I even checked if I am not importing wrong Modifier interface
    d

    Denis

    1 year ago
    do you use it inside Box? 'cause it's only available within BoxScope
    Vivek Sharma

    Vivek Sharma

    1 year ago
    oh sorry, I was not getting auto complete and I was getting some error,
    I got it now, my bad, thanks for the time