How to fullfill this UI in Xamarin forms?












0















I want to fulfill this UI in Xamarin Forms. This is the screenshot of my UI.



enter image description here



So I have no clue how to do this UI in xamarin forms. I'm confused is it cardview or just a view in which I have to add all this images and labels. I need some suggestions for implementing this UI.










share|improve this question























  • this and this is what you need

    – G.hakim
    Nov 22 '18 at 7:45











  • @User3452 Are you able to add that " HEART SHAPE " as well. if so kindly tell me how ?

    – Hashir Malik
    Feb 14 at 17:56











  • @HashirMalik its simple u just have to add two images in asset. One white heart and one orange heart. And write an event in which when u click on white heart image the image should be replaced by orange heart.

    – user3452
    Feb 15 at 7:48
















0















I want to fulfill this UI in Xamarin Forms. This is the screenshot of my UI.



enter image description here



So I have no clue how to do this UI in xamarin forms. I'm confused is it cardview or just a view in which I have to add all this images and labels. I need some suggestions for implementing this UI.










share|improve this question























  • this and this is what you need

    – G.hakim
    Nov 22 '18 at 7:45











  • @User3452 Are you able to add that " HEART SHAPE " as well. if so kindly tell me how ?

    – Hashir Malik
    Feb 14 at 17:56











  • @HashirMalik its simple u just have to add two images in asset. One white heart and one orange heart. And write an event in which when u click on white heart image the image should be replaced by orange heart.

    – user3452
    Feb 15 at 7:48














0












0








0


2






I want to fulfill this UI in Xamarin Forms. This is the screenshot of my UI.



enter image description here



So I have no clue how to do this UI in xamarin forms. I'm confused is it cardview or just a view in which I have to add all this images and labels. I need some suggestions for implementing this UI.










share|improve this question














I want to fulfill this UI in Xamarin Forms. This is the screenshot of my UI.



enter image description here



So I have no clue how to do this UI in xamarin forms. I'm confused is it cardview or just a view in which I have to add all this images and labels. I need some suggestions for implementing this UI.







user-interface xamarin.forms cardview






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 22 '18 at 6:41









user3452user3452

549




549













  • this and this is what you need

    – G.hakim
    Nov 22 '18 at 7:45











  • @User3452 Are you able to add that " HEART SHAPE " as well. if so kindly tell me how ?

    – Hashir Malik
    Feb 14 at 17:56











  • @HashirMalik its simple u just have to add two images in asset. One white heart and one orange heart. And write an event in which when u click on white heart image the image should be replaced by orange heart.

    – user3452
    Feb 15 at 7:48



















  • this and this is what you need

    – G.hakim
    Nov 22 '18 at 7:45











  • @User3452 Are you able to add that " HEART SHAPE " as well. if so kindly tell me how ?

    – Hashir Malik
    Feb 14 at 17:56











  • @HashirMalik its simple u just have to add two images in asset. One white heart and one orange heart. And write an event in which when u click on white heart image the image should be replaced by orange heart.

    – user3452
    Feb 15 at 7:48

















this and this is what you need

– G.hakim
Nov 22 '18 at 7:45





this and this is what you need

– G.hakim
Nov 22 '18 at 7:45













@User3452 Are you able to add that " HEART SHAPE " as well. if so kindly tell me how ?

– Hashir Malik
Feb 14 at 17:56





@User3452 Are you able to add that " HEART SHAPE " as well. if so kindly tell me how ?

– Hashir Malik
Feb 14 at 17:56













@HashirMalik its simple u just have to add two images in asset. One white heart and one orange heart. And write an event in which when u click on white heart image the image should be replaced by orange heart.

– user3452
Feb 15 at 7:48





@HashirMalik its simple u just have to add two images in asset. One white heart and one orange heart. And write an event in which when u click on white heart image the image should be replaced by orange heart.

– user3452
Feb 15 at 7:48












3 Answers
3






active

oldest

votes


















3














I assume that you will have several restaurants as some kind of search result and presumably the view will have to be scrollable if there are many results?



I would implement that with a ListView:



<ListView ItemsSource="{Binding Restaurants} HasUnevenRows="True">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell Height="100">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*">
<RowDefinition Height="*">
<RowDefinition Height="*">
<RowDefinition Height="*">
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Image Grid.Row="0" Grid.Column="0" Grid.RowSpan="4" Source="{Binding PreviewImage}" .... />
<Label Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding Title}" ... />
<Label Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding Address}" ... />
<Label Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding FoodTypes}" ... />
<!-- Add implementations for Rating, Like-Button and other labels in according rows and columns -->
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>


You would also need a Model class for your restaurant item which will contain all Data as I have sketched out within the {Binding XXX} tags. In your codebehind you have to create a List (or better an ObservableCollection ) and set that as the ListView's Itemssource.



Also you will probably need to add some effects or custom renderers for the visual touch-ups such as drop shadows, etc.






share|improve this answer































    2














    You can create a "CardView" using the “Frame” layout available in Xamarin.Forms.



    The code is as follows:



    CardViewTemplate.xml:



    <?xml version="1.0" encoding="UTF-8"?>
    <ContentView xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    x:Class="App68.CardViewTemplate">
    <ContentView.Content>
    <Frame IsClippedToBounds="True"
    HasShadow="True"
    Margin="30"
    BorderColor="White"
    BackgroundColor="White" >
    <Frame.OutlineColor>
    <OnPlatform x:TypeArguments="Color"
    Android="Gray"
    iOS="Gray"/>
    </Frame.OutlineColor>
    <Frame.Margin>
    <OnPlatform x:TypeArguments="Thickness"
    Android="10"
    iOS="10"/>
    </Frame.Margin>
    <StackLayout Orientation="Horizontal">

    <Grid VerticalOptions="CenterAndExpand"
    Padding="0"
    HorizontalOptions="FillAndExpand"
    BackgroundColor="Transparent">
    <Grid.RowDefinitions>
    <RowDefinition Height="25" />
    <RowDefinition Height="25" />
    <RowDefinition Height="25" />
    <RowDefinition Height="25" />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="100"/>
    <ColumnDefinition Width="*"/>
    <ColumnDefinition Width="*"/>
    <ColumnDefinition Width="*"/>
    </Grid.ColumnDefinitions>
    <Image Grid.Row="0" Grid.Column="0" Grid.RowSpan="4" Source="{Binding PreviewImage}" />
    <Label Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding RestaurantName}" />
    <Label Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding Address}" />
    <Label Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding FoodTypes}" />
    <Label Grid.Row="3" Grid.Column="1" Text="{Binding Rating}" />
    <Label Grid.Row="3" Grid.Column="2" Text="{Binding Time}" />
    <Label Grid.Row="3" Grid.Column="3" Text="{Binding Distance}" />
    </Grid>
    </StackLayout>
    </Frame>
    </ContentView.Content>
    </ContentView>


    MainPage.xaml



    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:local="clr-namespace:App68"
    x:Class="App68.MainPage">

    <StackLayout Orientation="Vertical">
    <Label Text="CardView Demo in Xamarin Forms"
    FontAttributes="Bold"
    FontSize="Medium"
    VerticalOptions="Start"
    HorizontalTextAlignment="Center"
    VerticalTextAlignment="Center"
    BackgroundColor="Transparent"
    HorizontalOptions="CenterAndExpand" />
    <ListView x:Name="listView"
    SelectedItem="{Binding SelcetedItem,Mode=TwoWay}"
    HasUnevenRows="True"
    ItemsSource="{Binding lstRestaurants}" >
    <ListView.ItemTemplate>
    <DataTemplate>
    <ViewCell>
    <local:CardViewTemplate/>
    </ViewCell>
    </DataTemplate>
    </ListView.ItemTemplate>
    </ListView>
    </StackLayout>

    </ContentPage>


    Restaurant.cs



    using System;
    using System.Collections.Generic;
    using System.Text;
    using Xamarin.Forms;

    namespace App68
    {
    class Restaurant
    {
    public String PreviewImage { get; set; }
    public string RestaurantName { get; set; }
    public bool IsFavorite { get; set; }
    public string Address { get; set; }
    public string FoodTypes { get; set; }
    public Image RatingIcon { get; set; }
    public double Rating { get; set; }
    public Image TimeIcon { get; set; }
    public double Time { get; set; }
    public Image DistanceIcon { get; set; }
    public double Distance { get; set; }
    }
    }


    RestaurantViewModel.cs



    using System;
    using System.Collections.Generic;
    using System.Text;
    using Xamarin.Forms;

    namespace App68
    {
    class RestaurantViewModel
    {
    public IList<Restaurant> lstRestaurants { get; set; }
    public object SelectedItem { get; set; }
    public RestaurantViewModel()
    {
    lstRestaurants = new List<Restaurant>();
    GenerateCardModel();
    }

    private void GenerateCardModel()
    {
    var restaurant1 = new Restaurant()
    {
    PreviewImage = "Restaurant_1.jpg",
    RestaurantName = "Premera restaurant",
    IsFavorite = true,
    Address = "Avenue Road 256",
    FoodTypes = "India Italy Chinese kitchen",
    Rating = 4.3,
    Time = 150,
    Distance = 3
    };

    lstRestaurants.Add(restaurant1);

    var restaurant2 = new Restaurant()
    {
    PreviewImage = "Restaurant_2.jpg",
    RestaurantName = "Premera restaurant",
    IsFavorite = true,
    Address = "Avenue Road 256",
    FoodTypes = "India Italy Chinese kitchen",
    Rating = 4.3,
    Time = 150,
    Distance = 3
    };

    lstRestaurants.Add(restaurant2);
    }
    }
    }


    The effect is as the follows:



    enter image description here






    share|improve this answer
























    • This is perfect. Great job AbbyWang.

      – user3452
      Nov 27 '18 at 5:47



















    0














    I used XFXCardview for this UI. And it seems to work pretty well. This is the GitHub link. So these are the changes I did in my code -



     <xfx:XfxCardView 
    BackgroundColor="White"
    CornerRadius="30"
    Elevation="20"
    HeightRequest="150" IsClippedToBounds="True">
    <Grid RowSpacing="0" >
    <Grid ColumnSpacing="0">
    <Grid.RowDefinitions >
    <RowDefinition Height="2*"></RowDefinition>
    <RowDefinition Height="*"></RowDefinition>

    <RowDefinition Height="Auto"></RowDefinition>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>

    <ColumnDefinition Width="*"/>
    <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <Frame Margin="10,10,10,-20" Padding="-30" CornerRadius="10" Grid.RowSpan="3" BackgroundColor="LightBlue" IsClippedToBounds="True">
    <Image Margin="-70,0,0,0" Grid.Row="0" Grid.Column="0" Grid.RowSpan="3" BackgroundColor="AliceBlue" Source="restaurantimage1.jpg" />
    </Frame>
    <Label Grid.Row="0" Grid.Column="1" Margin="0,30,30,0" HorizontalOptions="Start" Text="Premera restaurant" TextColor="Black" FontFamily="Bold,20"/>
    <Image Grid.Row="0" Grid.Column="1" Margin="0,30,10,0" HorizontalOptions="End" Source="whitehearticon3.jpg"/>
    <Label Grid.Row="1" Grid.Column="1" Margin="0,-20,40,0" HorizontalTextAlignment="Start" Text="Avenue Road,256" TextColor="Blue"/>
    <Label Grid.Row="2" Grid.Column="1" Margin="0,-40,40,0" VerticalTextAlignment="Start" Text="Indian,Italy,Chinese Kitchen" TextColor="LightGray"/>

    <Image Grid.Row="3" Grid.Column="1" Margin="0,-20,30,0" Source="whitestaricon1.png" WidthRequest="10" HeightRequest="10" BackgroundColor="Blue"/>
    <Label Grid.Row="3" Grid.Column="1" Margin="0,-20,40,0" HorizontalTextAlignment="Center" Text="4,3"/>
    </Grid>
    </Grid>
    </xfx:XfxCardView>





    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53425207%2fhow-to-fullfill-this-ui-in-xamarin-forms%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      3














      I assume that you will have several restaurants as some kind of search result and presumably the view will have to be scrollable if there are many results?



      I would implement that with a ListView:



      <ListView ItemsSource="{Binding Restaurants} HasUnevenRows="True">
      <ListView.ItemTemplate>
      <DataTemplate>
      <ViewCell Height="100">
      <Grid>
      <Grid.RowDefinitions>
      <RowDefinition Height="*">
      <RowDefinition Height="*">
      <RowDefinition Height="*">
      <RowDefinition Height="*">
      </Grid.RowDefinitions>
      <Grid.ColumnDefinitions>
      <ColumnDefinition Width="100"/>
      <ColumnDefinition Width="*"/>
      <ColumnDefinition Width="*"/>
      <ColumnDefinition Width="*"/>
      </Grid.ColumnDefinitions>
      <Image Grid.Row="0" Grid.Column="0" Grid.RowSpan="4" Source="{Binding PreviewImage}" .... />
      <Label Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding Title}" ... />
      <Label Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding Address}" ... />
      <Label Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding FoodTypes}" ... />
      <!-- Add implementations for Rating, Like-Button and other labels in according rows and columns -->
      </Grid>
      </ViewCell>
      </DataTemplate>
      </ListView.ItemTemplate>
      </ListView>


      You would also need a Model class for your restaurant item which will contain all Data as I have sketched out within the {Binding XXX} tags. In your codebehind you have to create a List (or better an ObservableCollection ) and set that as the ListView's Itemssource.



      Also you will probably need to add some effects or custom renderers for the visual touch-ups such as drop shadows, etc.






      share|improve this answer




























        3














        I assume that you will have several restaurants as some kind of search result and presumably the view will have to be scrollable if there are many results?



        I would implement that with a ListView:



        <ListView ItemsSource="{Binding Restaurants} HasUnevenRows="True">
        <ListView.ItemTemplate>
        <DataTemplate>
        <ViewCell Height="100">
        <Grid>
        <Grid.RowDefinitions>
        <RowDefinition Height="*">
        <RowDefinition Height="*">
        <RowDefinition Height="*">
        <RowDefinition Height="*">
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
        <ColumnDefinition Width="100"/>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Image Grid.Row="0" Grid.Column="0" Grid.RowSpan="4" Source="{Binding PreviewImage}" .... />
        <Label Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding Title}" ... />
        <Label Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding Address}" ... />
        <Label Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding FoodTypes}" ... />
        <!-- Add implementations for Rating, Like-Button and other labels in according rows and columns -->
        </Grid>
        </ViewCell>
        </DataTemplate>
        </ListView.ItemTemplate>
        </ListView>


        You would also need a Model class for your restaurant item which will contain all Data as I have sketched out within the {Binding XXX} tags. In your codebehind you have to create a List (or better an ObservableCollection ) and set that as the ListView's Itemssource.



        Also you will probably need to add some effects or custom renderers for the visual touch-ups such as drop shadows, etc.






        share|improve this answer


























          3












          3








          3







          I assume that you will have several restaurants as some kind of search result and presumably the view will have to be scrollable if there are many results?



          I would implement that with a ListView:



          <ListView ItemsSource="{Binding Restaurants} HasUnevenRows="True">
          <ListView.ItemTemplate>
          <DataTemplate>
          <ViewCell Height="100">
          <Grid>
          <Grid.RowDefinitions>
          <RowDefinition Height="*">
          <RowDefinition Height="*">
          <RowDefinition Height="*">
          <RowDefinition Height="*">
          </Grid.RowDefinitions>
          <Grid.ColumnDefinitions>
          <ColumnDefinition Width="100"/>
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="*"/>
          </Grid.ColumnDefinitions>
          <Image Grid.Row="0" Grid.Column="0" Grid.RowSpan="4" Source="{Binding PreviewImage}" .... />
          <Label Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding Title}" ... />
          <Label Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding Address}" ... />
          <Label Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding FoodTypes}" ... />
          <!-- Add implementations for Rating, Like-Button and other labels in according rows and columns -->
          </Grid>
          </ViewCell>
          </DataTemplate>
          </ListView.ItemTemplate>
          </ListView>


          You would also need a Model class for your restaurant item which will contain all Data as I have sketched out within the {Binding XXX} tags. In your codebehind you have to create a List (or better an ObservableCollection ) and set that as the ListView's Itemssource.



          Also you will probably need to add some effects or custom renderers for the visual touch-ups such as drop shadows, etc.






          share|improve this answer













          I assume that you will have several restaurants as some kind of search result and presumably the view will have to be scrollable if there are many results?



          I would implement that with a ListView:



          <ListView ItemsSource="{Binding Restaurants} HasUnevenRows="True">
          <ListView.ItemTemplate>
          <DataTemplate>
          <ViewCell Height="100">
          <Grid>
          <Grid.RowDefinitions>
          <RowDefinition Height="*">
          <RowDefinition Height="*">
          <RowDefinition Height="*">
          <RowDefinition Height="*">
          </Grid.RowDefinitions>
          <Grid.ColumnDefinitions>
          <ColumnDefinition Width="100"/>
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="*"/>
          </Grid.ColumnDefinitions>
          <Image Grid.Row="0" Grid.Column="0" Grid.RowSpan="4" Source="{Binding PreviewImage}" .... />
          <Label Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding Title}" ... />
          <Label Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding Address}" ... />
          <Label Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding FoodTypes}" ... />
          <!-- Add implementations for Rating, Like-Button and other labels in according rows and columns -->
          </Grid>
          </ViewCell>
          </DataTemplate>
          </ListView.ItemTemplate>
          </ListView>


          You would also need a Model class for your restaurant item which will contain all Data as I have sketched out within the {Binding XXX} tags. In your codebehind you have to create a List (or better an ObservableCollection ) and set that as the ListView's Itemssource.



          Also you will probably need to add some effects or custom renderers for the visual touch-ups such as drop shadows, etc.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 22 '18 at 7:58









          Markus MichelMarkus Michel

          1,517315




          1,517315

























              2














              You can create a "CardView" using the “Frame” layout available in Xamarin.Forms.



              The code is as follows:



              CardViewTemplate.xml:



              <?xml version="1.0" encoding="UTF-8"?>
              <ContentView xmlns="http://xamarin.com/schemas/2014/forms"
              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
              x:Class="App68.CardViewTemplate">
              <ContentView.Content>
              <Frame IsClippedToBounds="True"
              HasShadow="True"
              Margin="30"
              BorderColor="White"
              BackgroundColor="White" >
              <Frame.OutlineColor>
              <OnPlatform x:TypeArguments="Color"
              Android="Gray"
              iOS="Gray"/>
              </Frame.OutlineColor>
              <Frame.Margin>
              <OnPlatform x:TypeArguments="Thickness"
              Android="10"
              iOS="10"/>
              </Frame.Margin>
              <StackLayout Orientation="Horizontal">

              <Grid VerticalOptions="CenterAndExpand"
              Padding="0"
              HorizontalOptions="FillAndExpand"
              BackgroundColor="Transparent">
              <Grid.RowDefinitions>
              <RowDefinition Height="25" />
              <RowDefinition Height="25" />
              <RowDefinition Height="25" />
              <RowDefinition Height="25" />
              </Grid.RowDefinitions>
              <Grid.ColumnDefinitions>
              <ColumnDefinition Width="100"/>
              <ColumnDefinition Width="*"/>
              <ColumnDefinition Width="*"/>
              <ColumnDefinition Width="*"/>
              </Grid.ColumnDefinitions>
              <Image Grid.Row="0" Grid.Column="0" Grid.RowSpan="4" Source="{Binding PreviewImage}" />
              <Label Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding RestaurantName}" />
              <Label Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding Address}" />
              <Label Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding FoodTypes}" />
              <Label Grid.Row="3" Grid.Column="1" Text="{Binding Rating}" />
              <Label Grid.Row="3" Grid.Column="2" Text="{Binding Time}" />
              <Label Grid.Row="3" Grid.Column="3" Text="{Binding Distance}" />
              </Grid>
              </StackLayout>
              </Frame>
              </ContentView.Content>
              </ContentView>


              MainPage.xaml



              <?xml version="1.0" encoding="utf-8" ?>
              <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
              xmlns:local="clr-namespace:App68"
              x:Class="App68.MainPage">

              <StackLayout Orientation="Vertical">
              <Label Text="CardView Demo in Xamarin Forms"
              FontAttributes="Bold"
              FontSize="Medium"
              VerticalOptions="Start"
              HorizontalTextAlignment="Center"
              VerticalTextAlignment="Center"
              BackgroundColor="Transparent"
              HorizontalOptions="CenterAndExpand" />
              <ListView x:Name="listView"
              SelectedItem="{Binding SelcetedItem,Mode=TwoWay}"
              HasUnevenRows="True"
              ItemsSource="{Binding lstRestaurants}" >
              <ListView.ItemTemplate>
              <DataTemplate>
              <ViewCell>
              <local:CardViewTemplate/>
              </ViewCell>
              </DataTemplate>
              </ListView.ItemTemplate>
              </ListView>
              </StackLayout>

              </ContentPage>


              Restaurant.cs



              using System;
              using System.Collections.Generic;
              using System.Text;
              using Xamarin.Forms;

              namespace App68
              {
              class Restaurant
              {
              public String PreviewImage { get; set; }
              public string RestaurantName { get; set; }
              public bool IsFavorite { get; set; }
              public string Address { get; set; }
              public string FoodTypes { get; set; }
              public Image RatingIcon { get; set; }
              public double Rating { get; set; }
              public Image TimeIcon { get; set; }
              public double Time { get; set; }
              public Image DistanceIcon { get; set; }
              public double Distance { get; set; }
              }
              }


              RestaurantViewModel.cs



              using System;
              using System.Collections.Generic;
              using System.Text;
              using Xamarin.Forms;

              namespace App68
              {
              class RestaurantViewModel
              {
              public IList<Restaurant> lstRestaurants { get; set; }
              public object SelectedItem { get; set; }
              public RestaurantViewModel()
              {
              lstRestaurants = new List<Restaurant>();
              GenerateCardModel();
              }

              private void GenerateCardModel()
              {
              var restaurant1 = new Restaurant()
              {
              PreviewImage = "Restaurant_1.jpg",
              RestaurantName = "Premera restaurant",
              IsFavorite = true,
              Address = "Avenue Road 256",
              FoodTypes = "India Italy Chinese kitchen",
              Rating = 4.3,
              Time = 150,
              Distance = 3
              };

              lstRestaurants.Add(restaurant1);

              var restaurant2 = new Restaurant()
              {
              PreviewImage = "Restaurant_2.jpg",
              RestaurantName = "Premera restaurant",
              IsFavorite = true,
              Address = "Avenue Road 256",
              FoodTypes = "India Italy Chinese kitchen",
              Rating = 4.3,
              Time = 150,
              Distance = 3
              };

              lstRestaurants.Add(restaurant2);
              }
              }
              }


              The effect is as the follows:



              enter image description here






              share|improve this answer
























              • This is perfect. Great job AbbyWang.

                – user3452
                Nov 27 '18 at 5:47
















              2














              You can create a "CardView" using the “Frame” layout available in Xamarin.Forms.



              The code is as follows:



              CardViewTemplate.xml:



              <?xml version="1.0" encoding="UTF-8"?>
              <ContentView xmlns="http://xamarin.com/schemas/2014/forms"
              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
              x:Class="App68.CardViewTemplate">
              <ContentView.Content>
              <Frame IsClippedToBounds="True"
              HasShadow="True"
              Margin="30"
              BorderColor="White"
              BackgroundColor="White" >
              <Frame.OutlineColor>
              <OnPlatform x:TypeArguments="Color"
              Android="Gray"
              iOS="Gray"/>
              </Frame.OutlineColor>
              <Frame.Margin>
              <OnPlatform x:TypeArguments="Thickness"
              Android="10"
              iOS="10"/>
              </Frame.Margin>
              <StackLayout Orientation="Horizontal">

              <Grid VerticalOptions="CenterAndExpand"
              Padding="0"
              HorizontalOptions="FillAndExpand"
              BackgroundColor="Transparent">
              <Grid.RowDefinitions>
              <RowDefinition Height="25" />
              <RowDefinition Height="25" />
              <RowDefinition Height="25" />
              <RowDefinition Height="25" />
              </Grid.RowDefinitions>
              <Grid.ColumnDefinitions>
              <ColumnDefinition Width="100"/>
              <ColumnDefinition Width="*"/>
              <ColumnDefinition Width="*"/>
              <ColumnDefinition Width="*"/>
              </Grid.ColumnDefinitions>
              <Image Grid.Row="0" Grid.Column="0" Grid.RowSpan="4" Source="{Binding PreviewImage}" />
              <Label Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding RestaurantName}" />
              <Label Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding Address}" />
              <Label Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding FoodTypes}" />
              <Label Grid.Row="3" Grid.Column="1" Text="{Binding Rating}" />
              <Label Grid.Row="3" Grid.Column="2" Text="{Binding Time}" />
              <Label Grid.Row="3" Grid.Column="3" Text="{Binding Distance}" />
              </Grid>
              </StackLayout>
              </Frame>
              </ContentView.Content>
              </ContentView>


              MainPage.xaml



              <?xml version="1.0" encoding="utf-8" ?>
              <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
              xmlns:local="clr-namespace:App68"
              x:Class="App68.MainPage">

              <StackLayout Orientation="Vertical">
              <Label Text="CardView Demo in Xamarin Forms"
              FontAttributes="Bold"
              FontSize="Medium"
              VerticalOptions="Start"
              HorizontalTextAlignment="Center"
              VerticalTextAlignment="Center"
              BackgroundColor="Transparent"
              HorizontalOptions="CenterAndExpand" />
              <ListView x:Name="listView"
              SelectedItem="{Binding SelcetedItem,Mode=TwoWay}"
              HasUnevenRows="True"
              ItemsSource="{Binding lstRestaurants}" >
              <ListView.ItemTemplate>
              <DataTemplate>
              <ViewCell>
              <local:CardViewTemplate/>
              </ViewCell>
              </DataTemplate>
              </ListView.ItemTemplate>
              </ListView>
              </StackLayout>

              </ContentPage>


              Restaurant.cs



              using System;
              using System.Collections.Generic;
              using System.Text;
              using Xamarin.Forms;

              namespace App68
              {
              class Restaurant
              {
              public String PreviewImage { get; set; }
              public string RestaurantName { get; set; }
              public bool IsFavorite { get; set; }
              public string Address { get; set; }
              public string FoodTypes { get; set; }
              public Image RatingIcon { get; set; }
              public double Rating { get; set; }
              public Image TimeIcon { get; set; }
              public double Time { get; set; }
              public Image DistanceIcon { get; set; }
              public double Distance { get; set; }
              }
              }


              RestaurantViewModel.cs



              using System;
              using System.Collections.Generic;
              using System.Text;
              using Xamarin.Forms;

              namespace App68
              {
              class RestaurantViewModel
              {
              public IList<Restaurant> lstRestaurants { get; set; }
              public object SelectedItem { get; set; }
              public RestaurantViewModel()
              {
              lstRestaurants = new List<Restaurant>();
              GenerateCardModel();
              }

              private void GenerateCardModel()
              {
              var restaurant1 = new Restaurant()
              {
              PreviewImage = "Restaurant_1.jpg",
              RestaurantName = "Premera restaurant",
              IsFavorite = true,
              Address = "Avenue Road 256",
              FoodTypes = "India Italy Chinese kitchen",
              Rating = 4.3,
              Time = 150,
              Distance = 3
              };

              lstRestaurants.Add(restaurant1);

              var restaurant2 = new Restaurant()
              {
              PreviewImage = "Restaurant_2.jpg",
              RestaurantName = "Premera restaurant",
              IsFavorite = true,
              Address = "Avenue Road 256",
              FoodTypes = "India Italy Chinese kitchen",
              Rating = 4.3,
              Time = 150,
              Distance = 3
              };

              lstRestaurants.Add(restaurant2);
              }
              }
              }


              The effect is as the follows:



              enter image description here






              share|improve this answer
























              • This is perfect. Great job AbbyWang.

                – user3452
                Nov 27 '18 at 5:47














              2












              2








              2







              You can create a "CardView" using the “Frame” layout available in Xamarin.Forms.



              The code is as follows:



              CardViewTemplate.xml:



              <?xml version="1.0" encoding="UTF-8"?>
              <ContentView xmlns="http://xamarin.com/schemas/2014/forms"
              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
              x:Class="App68.CardViewTemplate">
              <ContentView.Content>
              <Frame IsClippedToBounds="True"
              HasShadow="True"
              Margin="30"
              BorderColor="White"
              BackgroundColor="White" >
              <Frame.OutlineColor>
              <OnPlatform x:TypeArguments="Color"
              Android="Gray"
              iOS="Gray"/>
              </Frame.OutlineColor>
              <Frame.Margin>
              <OnPlatform x:TypeArguments="Thickness"
              Android="10"
              iOS="10"/>
              </Frame.Margin>
              <StackLayout Orientation="Horizontal">

              <Grid VerticalOptions="CenterAndExpand"
              Padding="0"
              HorizontalOptions="FillAndExpand"
              BackgroundColor="Transparent">
              <Grid.RowDefinitions>
              <RowDefinition Height="25" />
              <RowDefinition Height="25" />
              <RowDefinition Height="25" />
              <RowDefinition Height="25" />
              </Grid.RowDefinitions>
              <Grid.ColumnDefinitions>
              <ColumnDefinition Width="100"/>
              <ColumnDefinition Width="*"/>
              <ColumnDefinition Width="*"/>
              <ColumnDefinition Width="*"/>
              </Grid.ColumnDefinitions>
              <Image Grid.Row="0" Grid.Column="0" Grid.RowSpan="4" Source="{Binding PreviewImage}" />
              <Label Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding RestaurantName}" />
              <Label Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding Address}" />
              <Label Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding FoodTypes}" />
              <Label Grid.Row="3" Grid.Column="1" Text="{Binding Rating}" />
              <Label Grid.Row="3" Grid.Column="2" Text="{Binding Time}" />
              <Label Grid.Row="3" Grid.Column="3" Text="{Binding Distance}" />
              </Grid>
              </StackLayout>
              </Frame>
              </ContentView.Content>
              </ContentView>


              MainPage.xaml



              <?xml version="1.0" encoding="utf-8" ?>
              <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
              xmlns:local="clr-namespace:App68"
              x:Class="App68.MainPage">

              <StackLayout Orientation="Vertical">
              <Label Text="CardView Demo in Xamarin Forms"
              FontAttributes="Bold"
              FontSize="Medium"
              VerticalOptions="Start"
              HorizontalTextAlignment="Center"
              VerticalTextAlignment="Center"
              BackgroundColor="Transparent"
              HorizontalOptions="CenterAndExpand" />
              <ListView x:Name="listView"
              SelectedItem="{Binding SelcetedItem,Mode=TwoWay}"
              HasUnevenRows="True"
              ItemsSource="{Binding lstRestaurants}" >
              <ListView.ItemTemplate>
              <DataTemplate>
              <ViewCell>
              <local:CardViewTemplate/>
              </ViewCell>
              </DataTemplate>
              </ListView.ItemTemplate>
              </ListView>
              </StackLayout>

              </ContentPage>


              Restaurant.cs



              using System;
              using System.Collections.Generic;
              using System.Text;
              using Xamarin.Forms;

              namespace App68
              {
              class Restaurant
              {
              public String PreviewImage { get; set; }
              public string RestaurantName { get; set; }
              public bool IsFavorite { get; set; }
              public string Address { get; set; }
              public string FoodTypes { get; set; }
              public Image RatingIcon { get; set; }
              public double Rating { get; set; }
              public Image TimeIcon { get; set; }
              public double Time { get; set; }
              public Image DistanceIcon { get; set; }
              public double Distance { get; set; }
              }
              }


              RestaurantViewModel.cs



              using System;
              using System.Collections.Generic;
              using System.Text;
              using Xamarin.Forms;

              namespace App68
              {
              class RestaurantViewModel
              {
              public IList<Restaurant> lstRestaurants { get; set; }
              public object SelectedItem { get; set; }
              public RestaurantViewModel()
              {
              lstRestaurants = new List<Restaurant>();
              GenerateCardModel();
              }

              private void GenerateCardModel()
              {
              var restaurant1 = new Restaurant()
              {
              PreviewImage = "Restaurant_1.jpg",
              RestaurantName = "Premera restaurant",
              IsFavorite = true,
              Address = "Avenue Road 256",
              FoodTypes = "India Italy Chinese kitchen",
              Rating = 4.3,
              Time = 150,
              Distance = 3
              };

              lstRestaurants.Add(restaurant1);

              var restaurant2 = new Restaurant()
              {
              PreviewImage = "Restaurant_2.jpg",
              RestaurantName = "Premera restaurant",
              IsFavorite = true,
              Address = "Avenue Road 256",
              FoodTypes = "India Italy Chinese kitchen",
              Rating = 4.3,
              Time = 150,
              Distance = 3
              };

              lstRestaurants.Add(restaurant2);
              }
              }
              }


              The effect is as the follows:



              enter image description here






              share|improve this answer













              You can create a "CardView" using the “Frame” layout available in Xamarin.Forms.



              The code is as follows:



              CardViewTemplate.xml:



              <?xml version="1.0" encoding="UTF-8"?>
              <ContentView xmlns="http://xamarin.com/schemas/2014/forms"
              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
              x:Class="App68.CardViewTemplate">
              <ContentView.Content>
              <Frame IsClippedToBounds="True"
              HasShadow="True"
              Margin="30"
              BorderColor="White"
              BackgroundColor="White" >
              <Frame.OutlineColor>
              <OnPlatform x:TypeArguments="Color"
              Android="Gray"
              iOS="Gray"/>
              </Frame.OutlineColor>
              <Frame.Margin>
              <OnPlatform x:TypeArguments="Thickness"
              Android="10"
              iOS="10"/>
              </Frame.Margin>
              <StackLayout Orientation="Horizontal">

              <Grid VerticalOptions="CenterAndExpand"
              Padding="0"
              HorizontalOptions="FillAndExpand"
              BackgroundColor="Transparent">
              <Grid.RowDefinitions>
              <RowDefinition Height="25" />
              <RowDefinition Height="25" />
              <RowDefinition Height="25" />
              <RowDefinition Height="25" />
              </Grid.RowDefinitions>
              <Grid.ColumnDefinitions>
              <ColumnDefinition Width="100"/>
              <ColumnDefinition Width="*"/>
              <ColumnDefinition Width="*"/>
              <ColumnDefinition Width="*"/>
              </Grid.ColumnDefinitions>
              <Image Grid.Row="0" Grid.Column="0" Grid.RowSpan="4" Source="{Binding PreviewImage}" />
              <Label Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding RestaurantName}" />
              <Label Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding Address}" />
              <Label Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding FoodTypes}" />
              <Label Grid.Row="3" Grid.Column="1" Text="{Binding Rating}" />
              <Label Grid.Row="3" Grid.Column="2" Text="{Binding Time}" />
              <Label Grid.Row="3" Grid.Column="3" Text="{Binding Distance}" />
              </Grid>
              </StackLayout>
              </Frame>
              </ContentView.Content>
              </ContentView>


              MainPage.xaml



              <?xml version="1.0" encoding="utf-8" ?>
              <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
              xmlns:local="clr-namespace:App68"
              x:Class="App68.MainPage">

              <StackLayout Orientation="Vertical">
              <Label Text="CardView Demo in Xamarin Forms"
              FontAttributes="Bold"
              FontSize="Medium"
              VerticalOptions="Start"
              HorizontalTextAlignment="Center"
              VerticalTextAlignment="Center"
              BackgroundColor="Transparent"
              HorizontalOptions="CenterAndExpand" />
              <ListView x:Name="listView"
              SelectedItem="{Binding SelcetedItem,Mode=TwoWay}"
              HasUnevenRows="True"
              ItemsSource="{Binding lstRestaurants}" >
              <ListView.ItemTemplate>
              <DataTemplate>
              <ViewCell>
              <local:CardViewTemplate/>
              </ViewCell>
              </DataTemplate>
              </ListView.ItemTemplate>
              </ListView>
              </StackLayout>

              </ContentPage>


              Restaurant.cs



              using System;
              using System.Collections.Generic;
              using System.Text;
              using Xamarin.Forms;

              namespace App68
              {
              class Restaurant
              {
              public String PreviewImage { get; set; }
              public string RestaurantName { get; set; }
              public bool IsFavorite { get; set; }
              public string Address { get; set; }
              public string FoodTypes { get; set; }
              public Image RatingIcon { get; set; }
              public double Rating { get; set; }
              public Image TimeIcon { get; set; }
              public double Time { get; set; }
              public Image DistanceIcon { get; set; }
              public double Distance { get; set; }
              }
              }


              RestaurantViewModel.cs



              using System;
              using System.Collections.Generic;
              using System.Text;
              using Xamarin.Forms;

              namespace App68
              {
              class RestaurantViewModel
              {
              public IList<Restaurant> lstRestaurants { get; set; }
              public object SelectedItem { get; set; }
              public RestaurantViewModel()
              {
              lstRestaurants = new List<Restaurant>();
              GenerateCardModel();
              }

              private void GenerateCardModel()
              {
              var restaurant1 = new Restaurant()
              {
              PreviewImage = "Restaurant_1.jpg",
              RestaurantName = "Premera restaurant",
              IsFavorite = true,
              Address = "Avenue Road 256",
              FoodTypes = "India Italy Chinese kitchen",
              Rating = 4.3,
              Time = 150,
              Distance = 3
              };

              lstRestaurants.Add(restaurant1);

              var restaurant2 = new Restaurant()
              {
              PreviewImage = "Restaurant_2.jpg",
              RestaurantName = "Premera restaurant",
              IsFavorite = true,
              Address = "Avenue Road 256",
              FoodTypes = "India Italy Chinese kitchen",
              Rating = 4.3,
              Time = 150,
              Distance = 3
              };

              lstRestaurants.Add(restaurant2);
              }
              }
              }


              The effect is as the follows:



              enter image description here







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Nov 23 '18 at 7:29









              AbbyWang - MSFTAbbyWang - MSFT

              53916




              53916













              • This is perfect. Great job AbbyWang.

                – user3452
                Nov 27 '18 at 5:47



















              • This is perfect. Great job AbbyWang.

                – user3452
                Nov 27 '18 at 5:47

















              This is perfect. Great job AbbyWang.

              – user3452
              Nov 27 '18 at 5:47





              This is perfect. Great job AbbyWang.

              – user3452
              Nov 27 '18 at 5:47











              0














              I used XFXCardview for this UI. And it seems to work pretty well. This is the GitHub link. So these are the changes I did in my code -



               <xfx:XfxCardView 
              BackgroundColor="White"
              CornerRadius="30"
              Elevation="20"
              HeightRequest="150" IsClippedToBounds="True">
              <Grid RowSpacing="0" >
              <Grid ColumnSpacing="0">
              <Grid.RowDefinitions >
              <RowDefinition Height="2*"></RowDefinition>
              <RowDefinition Height="*"></RowDefinition>

              <RowDefinition Height="Auto"></RowDefinition>
              </Grid.RowDefinitions>
              <Grid.ColumnDefinitions>

              <ColumnDefinition Width="*"/>
              <ColumnDefinition Width="Auto"/>
              </Grid.ColumnDefinitions>
              <Frame Margin="10,10,10,-20" Padding="-30" CornerRadius="10" Grid.RowSpan="3" BackgroundColor="LightBlue" IsClippedToBounds="True">
              <Image Margin="-70,0,0,0" Grid.Row="0" Grid.Column="0" Grid.RowSpan="3" BackgroundColor="AliceBlue" Source="restaurantimage1.jpg" />
              </Frame>
              <Label Grid.Row="0" Grid.Column="1" Margin="0,30,30,0" HorizontalOptions="Start" Text="Premera restaurant" TextColor="Black" FontFamily="Bold,20"/>
              <Image Grid.Row="0" Grid.Column="1" Margin="0,30,10,0" HorizontalOptions="End" Source="whitehearticon3.jpg"/>
              <Label Grid.Row="1" Grid.Column="1" Margin="0,-20,40,0" HorizontalTextAlignment="Start" Text="Avenue Road,256" TextColor="Blue"/>
              <Label Grid.Row="2" Grid.Column="1" Margin="0,-40,40,0" VerticalTextAlignment="Start" Text="Indian,Italy,Chinese Kitchen" TextColor="LightGray"/>

              <Image Grid.Row="3" Grid.Column="1" Margin="0,-20,30,0" Source="whitestaricon1.png" WidthRequest="10" HeightRequest="10" BackgroundColor="Blue"/>
              <Label Grid.Row="3" Grid.Column="1" Margin="0,-20,40,0" HorizontalTextAlignment="Center" Text="4,3"/>
              </Grid>
              </Grid>
              </xfx:XfxCardView>





              share|improve this answer




























                0














                I used XFXCardview for this UI. And it seems to work pretty well. This is the GitHub link. So these are the changes I did in my code -



                 <xfx:XfxCardView 
                BackgroundColor="White"
                CornerRadius="30"
                Elevation="20"
                HeightRequest="150" IsClippedToBounds="True">
                <Grid RowSpacing="0" >
                <Grid ColumnSpacing="0">
                <Grid.RowDefinitions >
                <RowDefinition Height="2*"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>

                <RowDefinition Height="Auto"></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>

                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Frame Margin="10,10,10,-20" Padding="-30" CornerRadius="10" Grid.RowSpan="3" BackgroundColor="LightBlue" IsClippedToBounds="True">
                <Image Margin="-70,0,0,0" Grid.Row="0" Grid.Column="0" Grid.RowSpan="3" BackgroundColor="AliceBlue" Source="restaurantimage1.jpg" />
                </Frame>
                <Label Grid.Row="0" Grid.Column="1" Margin="0,30,30,0" HorizontalOptions="Start" Text="Premera restaurant" TextColor="Black" FontFamily="Bold,20"/>
                <Image Grid.Row="0" Grid.Column="1" Margin="0,30,10,0" HorizontalOptions="End" Source="whitehearticon3.jpg"/>
                <Label Grid.Row="1" Grid.Column="1" Margin="0,-20,40,0" HorizontalTextAlignment="Start" Text="Avenue Road,256" TextColor="Blue"/>
                <Label Grid.Row="2" Grid.Column="1" Margin="0,-40,40,0" VerticalTextAlignment="Start" Text="Indian,Italy,Chinese Kitchen" TextColor="LightGray"/>

                <Image Grid.Row="3" Grid.Column="1" Margin="0,-20,30,0" Source="whitestaricon1.png" WidthRequest="10" HeightRequest="10" BackgroundColor="Blue"/>
                <Label Grid.Row="3" Grid.Column="1" Margin="0,-20,40,0" HorizontalTextAlignment="Center" Text="4,3"/>
                </Grid>
                </Grid>
                </xfx:XfxCardView>





                share|improve this answer


























                  0












                  0








                  0







                  I used XFXCardview for this UI. And it seems to work pretty well. This is the GitHub link. So these are the changes I did in my code -



                   <xfx:XfxCardView 
                  BackgroundColor="White"
                  CornerRadius="30"
                  Elevation="20"
                  HeightRequest="150" IsClippedToBounds="True">
                  <Grid RowSpacing="0" >
                  <Grid ColumnSpacing="0">
                  <Grid.RowDefinitions >
                  <RowDefinition Height="2*"></RowDefinition>
                  <RowDefinition Height="*"></RowDefinition>

                  <RowDefinition Height="Auto"></RowDefinition>
                  </Grid.RowDefinitions>
                  <Grid.ColumnDefinitions>

                  <ColumnDefinition Width="*"/>
                  <ColumnDefinition Width="Auto"/>
                  </Grid.ColumnDefinitions>
                  <Frame Margin="10,10,10,-20" Padding="-30" CornerRadius="10" Grid.RowSpan="3" BackgroundColor="LightBlue" IsClippedToBounds="True">
                  <Image Margin="-70,0,0,0" Grid.Row="0" Grid.Column="0" Grid.RowSpan="3" BackgroundColor="AliceBlue" Source="restaurantimage1.jpg" />
                  </Frame>
                  <Label Grid.Row="0" Grid.Column="1" Margin="0,30,30,0" HorizontalOptions="Start" Text="Premera restaurant" TextColor="Black" FontFamily="Bold,20"/>
                  <Image Grid.Row="0" Grid.Column="1" Margin="0,30,10,0" HorizontalOptions="End" Source="whitehearticon3.jpg"/>
                  <Label Grid.Row="1" Grid.Column="1" Margin="0,-20,40,0" HorizontalTextAlignment="Start" Text="Avenue Road,256" TextColor="Blue"/>
                  <Label Grid.Row="2" Grid.Column="1" Margin="0,-40,40,0" VerticalTextAlignment="Start" Text="Indian,Italy,Chinese Kitchen" TextColor="LightGray"/>

                  <Image Grid.Row="3" Grid.Column="1" Margin="0,-20,30,0" Source="whitestaricon1.png" WidthRequest="10" HeightRequest="10" BackgroundColor="Blue"/>
                  <Label Grid.Row="3" Grid.Column="1" Margin="0,-20,40,0" HorizontalTextAlignment="Center" Text="4,3"/>
                  </Grid>
                  </Grid>
                  </xfx:XfxCardView>





                  share|improve this answer













                  I used XFXCardview for this UI. And it seems to work pretty well. This is the GitHub link. So these are the changes I did in my code -



                   <xfx:XfxCardView 
                  BackgroundColor="White"
                  CornerRadius="30"
                  Elevation="20"
                  HeightRequest="150" IsClippedToBounds="True">
                  <Grid RowSpacing="0" >
                  <Grid ColumnSpacing="0">
                  <Grid.RowDefinitions >
                  <RowDefinition Height="2*"></RowDefinition>
                  <RowDefinition Height="*"></RowDefinition>

                  <RowDefinition Height="Auto"></RowDefinition>
                  </Grid.RowDefinitions>
                  <Grid.ColumnDefinitions>

                  <ColumnDefinition Width="*"/>
                  <ColumnDefinition Width="Auto"/>
                  </Grid.ColumnDefinitions>
                  <Frame Margin="10,10,10,-20" Padding="-30" CornerRadius="10" Grid.RowSpan="3" BackgroundColor="LightBlue" IsClippedToBounds="True">
                  <Image Margin="-70,0,0,0" Grid.Row="0" Grid.Column="0" Grid.RowSpan="3" BackgroundColor="AliceBlue" Source="restaurantimage1.jpg" />
                  </Frame>
                  <Label Grid.Row="0" Grid.Column="1" Margin="0,30,30,0" HorizontalOptions="Start" Text="Premera restaurant" TextColor="Black" FontFamily="Bold,20"/>
                  <Image Grid.Row="0" Grid.Column="1" Margin="0,30,10,0" HorizontalOptions="End" Source="whitehearticon3.jpg"/>
                  <Label Grid.Row="1" Grid.Column="1" Margin="0,-20,40,0" HorizontalTextAlignment="Start" Text="Avenue Road,256" TextColor="Blue"/>
                  <Label Grid.Row="2" Grid.Column="1" Margin="0,-40,40,0" VerticalTextAlignment="Start" Text="Indian,Italy,Chinese Kitchen" TextColor="LightGray"/>

                  <Image Grid.Row="3" Grid.Column="1" Margin="0,-20,30,0" Source="whitestaricon1.png" WidthRequest="10" HeightRequest="10" BackgroundColor="Blue"/>
                  <Label Grid.Row="3" Grid.Column="1" Margin="0,-20,40,0" HorizontalTextAlignment="Center" Text="4,3"/>
                  </Grid>
                  </Grid>
                  </xfx:XfxCardView>






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 27 '18 at 5:53









                  user3452user3452

                  549




                  549






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53425207%2fhow-to-fullfill-this-ui-in-xamarin-forms%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      這個網誌中的熱門文章

                      Tangent Lines Diagram Along Smooth Curve

                      Yusuf al-Mu'taman ibn Hud

                      Zucchini