简体   繁体   中英

how to add jpg image to IOs project for Visual studio with xamarin

I got a problem in my project in Visual studio with Xamarin. I want to add a .jpg image to images sets in IOS project's asset catalog. But VS allow me add only .png files. Is there any way to add .jpg image to use it in storyboard and in code.

You can add them under the folder Resources . Detail Refer Working With Resources 在此处输入图片说明

Usage:

In Code

image.Image = UIImage.FromBundle("test.jpg");

In Storyboard 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM