https://kotlinlang.org logo
#compose
Title
# compose
a

A. Sachdeva

03/06/2021, 7:53 PM
hi, i opened a new project and my editor seems to give no preview for any function. how can i fix this?
1
g

Gabriel

03/06/2021, 8:03 PM
I think it's because Text by itself doesn't have dimensions, wrap it in a Box or something and you'll see it
Copy code
Box {
        Text(text = "hello $text")
    }
a

A. Sachdeva

03/06/2021, 8:05 PM
no sure, it works on the default generated MainActivity:
never mind tho. it was somehow a problem with the kt file. i created a new kt file and it started to work😅
g

Gabriel

03/06/2021, 8:06 PM
oh lol
a

A. Sachdeva

03/06/2021, 8:06 PM
btw is there any alternative for "textallcaps" attribute in compose?
i can always do "myString".toUpperCase() , before setting up in textfield, but i was wondering if i could make a generic style out of it
m

Mjahangiry75

03/06/2021, 8:25 PM
try to create a custom @Composable that shows strings Upper Cased
v

Vivek Sharma

03/07/2021, 9:59 AM
you can also use annotated string , if you want to make it like some complex upper or lower case letters in between string