Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ionixjunior/572365a1b780848e59688eb07c3cbc04 to your computer and use it in GitHub Desktop.
Save ionixjunior/572365a1b780848e59688eb07c3cbc04 to your computer and use it in GitHub Desktop.
using System;
using Xamarin.Forms.Platform.Android;
using Xamarin.Forms;
using Core.Droid.Renders;
using Core.Controls;
using Android.Widget;
[assembly: ExportRenderer (typeof (CustomImageCell), typeof (CustomImageCellRenderer))]
namespace Core.Droid.Renders
{
public class CustomImageCellRenderer : ImageCellRenderer
{
protected override Android.Views.View GetCellCore (Cell item, Android.Views.View convertView, Android.Views.ViewGroup parent, Android.Content.Context context)
{
LinearLayout cell = (LinearLayout)base.GetCellCore (item, convertView, parent, context);
ImageView image = (ImageView)cell.GetChildAt (0);
image.SetScaleType (ImageView.ScaleType.Center);
return cell;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment