c# - How to create a ListView with a static image size Xamarin Forms -


i have list works fine, when bind large image not fill's entire image box size set 100x100, how create image size able adapt resolution ?

xaml code :

<listview backgroundcolor="white" grid.row="2" separatorvisibility="default" hasunevenrows="true" itemselected="item" x:name="listview">   <listview.itemtemplate>     <datatemplate>       <viewcell>         <stacklayout orientation="horizontal">           <image widthrequest="100" heightrequest="100" source="{binding image}"/>           <stacklayout orientation="vertical">             <label text="{binding title}" />             <label text="{binding subtitle}" />           </stacklayout>         </stacklayout>       </viewcell>     </datatemplate>   </listview.itemtemplate> </listview> 

the result : enter image description here

even if put 100x100 image did not complete fill entire box!

the image control has property aspect defines how image filled frame.

  1. aspectfill - scale image fill view. parts may clipped in order fill view.

  2. aspectfit - scale image fit view. parts may left empty (letter boxing).

  3. fill - scale image fill view. scaling may not uniform in x , y.

aspect - gets or sets scaling mode image. bindable property.

use fill if want fill view.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -