Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Blurred text on Xamarin.Label inside a ViewCell on iPad

$
0
0

Hi,

I've implemented a custom cell class that extends ViewCell, it contains two Labels nested inside a StackLayout. On Android it looks fine but on iOS the text is noticeably blurred compared to a standard TextCell.

The code from my object's constructor is below and screenshot from an iPad attached, the rows that have email icons on them are the custom ViewCell (Lead Partner Email etc).

// construct labels for label and value text, platform specific colours and sizes to match other Xamarin Cell objects
var textLabel = new Label
{
    Text = this.Text, 
    TextColor = Device.OnPlatform(Color.Default, Color.Accent, Color.Default)
};
var detailLabel = new Label
{
    Text = this.Detail,
    TextColor = Device.OnPlatform(Color.Accent, Color.Default, Color.Default),
    Font = Device.OnPlatform(Font.SystemFontOfSize(NamedSize.Micro), Font.Default, Font.Default)
};

// create a layout for this cell
var layout = new StackLayout
{
    Padding = new Thickness(16, 3),
    Orientation = StackOrientation.Horizontal,
    Children =
    {
        new StackLayout
        {
            HorizontalOptions = LayoutOptions.StartAndExpand,
            Spacing = 0,
            Children =
            {
                textLabel,
                detailLabel
            }
        },
        new Image
        {
            Source = ImageSource.FromFile(imageFilename),
            Aspect = Aspect.AspectFit
        }
    }
};

this.View = layout;

Any help would be appreciated!


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>