6

I am trying to make a card based listView In Xamarin Forms based off of ahaliav fox's xaml example here however I am not getting anywhere near what he got I only have one text label that I need to display in the card

heres my xaml code:

    <?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="WebSearch.CountySelect" BackgroundColor="Gray">
  <ListView x:Name="listView">
    <ListView.ItemTemplate>
      <DataTemplate>
        <ViewCell>

          <Frame Padding="0,0,0,3">
            <Frame.Content>
              <Frame Padding="15,15,15,15"   OutlineColor="Gray" BackgroundColor="White">
                <Frame.Content>
                  <StackLayout Padding="20,0,0,0"  Orientation="Horizontal" HorizontalOptions="CenterAndExpand">
                    <Label Text="{Binding Name}"
                           FontFamily="OpenSans-Light"
                           FontSize="9"
                           TextColor="#69add1"/>
                  </StackLayout>

                </Frame.Content>

              </Frame>
            </Frame.Content>

          </Frame>

        </ViewCell>
      </DataTemplate>
    </ListView.ItemTemplate>
    </ListView>
</ContentPage>

EDIT: I got the ListView item to resemble a card by using a Frame however The text on the label cuts off half way unless I make the text size 9 or lower that's way to small any way to fix this bug?

I have updated my code to reflect the new issue i'm having

any help would be amazing!

A-Sharabiani
  • 17,750
  • 17
  • 113
  • 128
Phoneswapshop
  • 1,367
  • 8
  • 24
  • 47
  • What is your question? You haven't actually asked one, and you haven't clearly stated what problem you're having. – Jason May 10 '16 at 17:56
  • I updated my question to resemble my issue please check it out :) – Phoneswapshop May 10 '16 at 19:35
  • How long is the name in the `Label`? Also how big is the device your testing on? Have your tried removing some of the `Padding` to see if that helps? Or try setting the `Label.LineBreakMode` to `WordWrap` – hvaughan3 May 10 '16 at 19:50

1 Answers1

9

Try setting the ListView.HasUnevenRows property to true

Dean Chalk
  • 20,076
  • 6
  • 59
  • 90