image do not show in .net android?

mc 5,426 Reputation points
2024-05-19T15:06:04.2166667+00:00

I add ImageView in activity_main.xml and set the src

android:src="@mipmap/tab_index"

but it is not show.

just white .

Developer technologies .NET .NET MAUI
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2024-05-20T01:43:55.5+00:00

    Hello,

    If you want to set a picture to the ImageView, please create drawable folder in Resources folder. Then copy your picture to this drawable folder and make sure this build action of picture is AndroidResource.

    In the end, change your ImageView src like following code.

    <ImageView
         android:contentDescription="this tab index"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:src="@drawable/tab_index"/>
    

    By the way, mipmap A folder used to store image resources, mainly for application icons.

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.