Ask Your Question
3

What is the method to position the image slightly outside the cardView?

asked 2022-04-19 11:00:00 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-05-27 08:00:00 +0000

nofretete gravatar image

One way to position the image slightly outside the cardView is to use negative margin on the ImageView. For example, if you want to position the image 10dp outside the cardView on the left side, you can add the following attribute to the ImageView in your layout:

<ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="-10dp" /> 

This will move the ImageView 10dp to the left of its original position, effectively placing it slightly outside the cardView. You can adjust the margin value accordingly to position the image outside the cardView in other directions as well.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-04-19 11:00:00 +0000

Seen: 9 times

Last updated: May 27 '21