Jump to content

Android studio card clickable

Go to solution Solved by ladybug,
On 6/15/2023 at 6:21 PM, stefanmz said:

Hi! I am using Android studio with Jetpack compose and I want to make my Card element clickable when you click or tap there is an action but from all information I see that I have to use .clickable from modifier and I don't have such a thing even with the right imports it doesn't recognize it it says unresolved reference I am literally using the newest APIs compose Android studio compiler everything is newest versions even beta. So how do I do it?

 

yeah I solved it apparently it has an OnClick{} thing

Hi! I am using Android studio with Jetpack compose and I want to make my Card element clickable when you click or tap there is an action but from all information I see that I have to use .clickable from modifier and I don't have such a thing even with the right imports it doesn't recognize it it says unresolved reference I am literally using the newest APIs compose Android studio compiler everything is newest versions even beta. So how do I do it?

 

Link to comment
https://linustechtips.com/topic/1513329-android-studio-card-clickable/
Share on other sites

Link to post
Share on other sites

On 6/15/2023 at 6:21 PM, stefanmz said:

Hi! I am using Android studio with Jetpack compose and I want to make my Card element clickable when you click or tap there is an action but from all information I see that I have to use .clickable from modifier and I don't have such a thing even with the right imports it doesn't recognize it it says unresolved reference I am literally using the newest APIs compose Android studio compiler everything is newest versions even beta. So how do I do it?

 

yeah I solved it apparently it has an OnClick{} thing

Link to post
Share on other sites

setOnClickListener is a member of android.view.View, which is the base class of every control, so you can make anything clickable that way.

Remember to either quote or @mention others, so they are notified of your reply

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×