How to build ImageView in Xamarin?
نوشته شده توسط : dotnek

Xamarin has many capabilities and using programming with C # language , you can use the capabilities available in Xamarin or create capabilities to use. In this article, you will learn how to upload an image to Xamarin.Forms.

In this article you will learn:

How to create an ImageView using the XAML file in Xamarin.Forms?

- How to change the appearance of the Image?

- How to display local file images.

What is ImageView?

ImageView is a method used to upload and place images in the application. When we want to put an image in our application, we use this method to upload the image.Learn how to create an ImageView and display images in Xamarin using Visual Studio

The requirements for displaying images in Xamarin.Forms are as follows:

- Install the latest version of Visual Studio

- Install Mobile development with .NET1- Open Visual Studio.

2- Create a new black Xamarin.Forms app.

3- Make sure your application supports the .NET Standard mechanism for sharing code written in C # for output on all platforms.

Note:

The name of the project created in this tutorial is ImageTutorial. It is emphasized to be careful in choosing the name of the project. Project name and solution must be the same, name both ImageTutorial.- Double-click the MainPage.xaml file in the Solution Explorer section of the ImageTutorial project and replace the code below with the code on that page.

<! -? xml version = "1.0" encoding = "utf-8"? ->

<contentpage xmlns = "http://xamarin.com/schemas/2014/forms" xmlns: x = "http://schemas.microsoft.com/winfx/2009/xaml" x: class = "ImageTutorial.MainPage">

<stacklayout margin = "20,35,20,20">

<img source = "http://upload.wikimedia.org/wikipedia/commons/thumb/f/fc/Papio_anubis_%28Serengeti%2C_2009%29.jpg/200px-Papio_anubis_%28Serengeti%2C_2009%29.jpg" heightrequest = " 300 ">

</stacklayout>

</contentpage>

By entering this code, you specify a UI for the page and this UI contains an image. The Image. Source attribute in this code is used to specify the URI of the image we want to display in the ImageView section. In other words, this attribute allows us to upload images from different sources, addresses and URIs.

Note:

The Heightrequest attribute is used to specify the length of the image to be displayed in device-independent units.- Run the program by pressing the Start button or the Ctrl + F5 key combination and view the output of your written code in the emulators. 

Read more on:https://www.dotnek.com/Blog/Apps/how-to-build-imageview-in-xamarin

link:https://dotnek.mystrikingly.com/

Related link: DOTNEK BLOG





:: برچسب‌ها: dotnek , seo , site ,
:: بازدید از این مطلب : 95
|
امتیاز مطلب : 0
|
تعداد امتیازدهندگان : 0
|
مجموع امتیاز : 0
تاریخ انتشار : دو شنبه 4 مرداد 1400 | نظرات ()
مطالب مرتبط با این پست
لیست
می توانید دیدگاه خود را بنویسید


نام
آدرس ایمیل
وب سایت/بلاگ
:) :( ;) :D
;)) :X :? :P
:* =(( :O };-
:B /:) =DD :S
-) :-(( :-| :-))
نظر خصوصی

 کد را وارد نمایید:

آپلود عکس دلخواه: