Created
August 13, 2019 19:41
-
-
Save tientham/7867e6c39b5bc49e46da89f29bc1dfdb to your computer and use it in GitHub Desktop.
Achieve an rounded card with image as background in xamarin forms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are 2 ways: | |
1- Frame and Image | |
<Frame CornerRadius="10" Margin="0" Padding="0" IsClippedToBounds="True" HasShadow="false"> | |
<Image Source="{Binding Picture}" Aspect="AspectFill" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"/> | |
</Frame> | |
2- FFImageLoading | |
<ffimageloading:CachedImage HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" | |
Aspect="AspectFill" DownsampleToViewSize="true" Source = "{Binding Picture}"> | |
<ffimageloading:CachedImage.Transformations > | |
<fftransformations:CornersTransformation | |
CornersTransformType="AllRounded" | |
BottomLeftCornerSize="10" TopLeftCornerSize="10" | |
TopRightCornerSize="10" BottomRightCornerSize="10"/> | |
</ffimageloading:CachedImage.Transformations> | |
</ffimageloading:CachedImage> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment