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

Scaling views - bug?

$
0
0

I think I might have encountered a bug regarding scaling views and the internal calculations of view layout.

Here's two xaml examples:

<StackLayout HorizontalOptions="Center" VerticalOptions="Center" BackgroundColor="#f00" >
        <Image Source="smile.png" BackgroundColor="#0f0" Scale="1" />
        <BoxView BackgroundColor="#00f" HeightRequest="30" />
        <BoxView BackgroundColor="#00f" HeightRequest="30" />
        <BoxView BackgroundColor="#00f" HeightRequest="30" />
</StackLayout>

and

<StackLayout HorizontalOptions="Center" VerticalOptions="Center" BackgroundColor="#f00" >
        <Image Source="smile.png" BackgroundColor="#0f0" Scale="0.1" />
        <BoxView BackgroundColor="#00f" HeightRequest="30" />
        <BoxView BackgroundColor="#00f" HeightRequest="30" />
        <BoxView BackgroundColor="#00f" HeightRequest="30" />
</StackLayout>

Note the scaling of the Image.
The image is 400x400 pixels.
The last 3 boxviews are positioned in the same location no matter the scaling of the first element. I would have expected the last 3 elements to occupy the empty space when scaling down the first element.

See attached screen shots.

Is this a bug or expected behavior?
image
image


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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