Giter VIP home page Giter VIP logo

xamarin.forms-cardview's Introduction

Xamarin.Forms-CardView

ATTENTION - ALERT

This package is not currently under maintenance due to heavy workload on my part. If you feel there's an error or bug somewhere and you can fix it, feel free to contribute. I'll be more than happy to accept them. Thank you.


A Package to create a CardView using Xamarin.Forms that works on the three platforms (Android, iOS, UWP) It is simple to use in a straight forward fashion. You may either use it in C#, or in XAML.


To Install this nuget package (.Net Framework):

PM> Install-Package XamarinForms.CardView

To Install package (.Net Standard 2.0)

PM> Install-Package XamarinForms.CardView.NetStandard


CardView Bindable Properties

Property Property Name Property Type Usage Default Value
CardViewContentProperty CardViewContent View CardView Content None
CardViewHeightRequestProperty CardViewHeightRequest double Height Request -1
CardViewOutlineColorProperty CardViewOutlineColor Color Outline Color Transparent
CardViewInnerFrameOutlineColorProperty CardViewInnerFrameOutlineColor Color Inner OutlineColor Transparent
CardViewOutlineColorThicknessProperty CardViewOutlineColorThickness Thickness OutlineColor Thickness 0
CardViewInnerFrameOutlineColorThicknessProperty CardViewInnerFrameOutlineColorThickness Thickness Inner OutlineColor Thickness 0
CardViewHasShadowProperty CardViewHasShadow bool Card View Shadow false
IsSwipeToClearEnabledProperty IsSwipeToClearEnabled bool Enable to clear Content With a Swipe false
CardViewHorizontalOptionsProperty CardViewHorizontalOptions LayoutOptions Set Card View Horisontal Options Start

CardViewContent Example:

	<CardView>
		<CardView.CardViewContent>
			<StackLayout>
				<Label Text="Label inside StackLayout forming the CardViewContent"></Label>
			</StackLayout>
		</CardView.CardViewContent>
	</CardView>

CardViewHeightRequest Example:

	<cardView:CardView CardViewHeightRequest="100">
		<cardView:CardView.CardViewContent>
			<StackLayout>
				<Label Text="I have 100 Height"></Label>
			</StackLayout>
		</cardView:CardView.CardViewContent>
	</cardView:CardView>

CardViewOutlineColor Example:

	<cardView:CardView CardViewHeightRequest="100" CardViewOutlineColor="Black" CardViewOutlineColorThickness="2">
		<cardView:CardView.CardViewContent>
			<StackLayout  BackgroundColor="White">
				<Label Text="I have 100 HeightRequest, and a black outline color"></Label>
			</StackLayout>
		</cardView:CardView.CardViewContent>
	</cardView:CardView>

CardViewInnerFrameOutlineColor Example:

	<cardView:CardView CardViewHeightRequest="100" CardViewOutlineColor="Black" CardViewOutlineColorThickness="2"
				   CardViewInnerFrameOutlineColor="Aqua" CardViewInnerFrameOutlineColorThickness="2">
		<cardView:CardView.CardViewContent>
			<StackLayout  BackgroundColor="White">
				<Label Text="I have 100 Height, and a black outline color, and an inline outline color Aqua"></Label>
			</StackLayout>
		</cardView:CardView.CardViewContent>
	</cardView:CardView>

CardViewHasShadow Example:

	<cardView:CardView CardViewHeightRequest="100" CardViewOutlineColor="Gray" CardViewOutlineColorThickness="2" CardViewHasShadow="True">
		<cardView:CardView.CardViewContent>
			<StackLayout  BackgroundColor="White">
				<Label Text="Gray Outline Color with Shadow"></Label>
			</StackLayout>
		</cardView:CardView.CardViewContent>
	</cardView:CardView>

IsSwipeToClearEnabled Example:

	<cardView:CardView CardViewHeightRequest="100" CardViewOutlineColor="Gray" CardViewOutlineColorThickness="2" CardViewHasShadow="True"
						   IsSwipeToClearEnabled="True">
		<cardView:CardView.CardViewContent>
			<StackLayout  BackgroundColor="White">
				<Label Text="Swipe me and I will go away"></Label>
			</StackLayout>
		</cardView:CardView.CardViewContent>
	</cardView:CardView>

xamarin.forms-cardview's People

Contributors

frankfolsche avatar tiger4589 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xamarin.forms-cardview's Issues

Not compatible with .NET Standard 2.0

Getting the an error message when I try out the example XAML code.

<CardView.CardViewContent> </CardView.CardViewContent>

Type CardView not found in xmlns http://xamarin.com/schemas/2014/forms

I believe this error is being caused by the incompatibility, since Visual Studio is having to revert the package to the .NET Framework, instead of using .NET Standard

Not Working in iOS 10.3

Hi there,

This library doesn't work in iOS 10.3, here is my 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"
	xmlns:cardView="clr-namespace:CardView;assembly=CardView"
	x:Class="Housecode.MainPage">
    <ContentPage.Content>
		<StackLayout Padding="20" Margin="0">
            <cardView:CardView
				x:Name="card1"
				HorizontalOptions="Start"
				CardViewHeightRequest="-1"
				BackgroundColor="White"
				CardViewHasShadow="true">
                <cardView:CardView.CardViewContent>
                    <StackLayout Orientation="Vertical" Padding="5, 2, 5, 2">
                        <Label Text="I am a label, inside a StackLayout inside the CardView Content"></Label>
                        <Label Text="I may not look nice, but I don't have all my properties set."></Label>
                    </StackLayout>
                </cardView:CardView.CardViewContent>
            </cardView:CardView>
            <cardView:CardView
            	x:Name="card2"
            	HorizontalOptions="Start"
				CardViewHeightRequest="-1"
            	BackgroundColor="Silver"
            	CardViewHasShadow="true">
                <cardView:CardView.CardViewContent>
                    <StackLayout Orientation="Vertical" Padding="5, 2, 5, 2">
                        <Label Text="What about an image?"></Label>
                        <Image Source="icon.png"></Image>
                    </StackLayout>
                </cardView:CardView.CardViewContent>
            </cardView:CardView>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>

and here is the output
https://prnt.sc/f9lj49

Thanks,
Cahyo

Its not working

Its not working can you tell me what and all i have to do in the project

Not working

When trying to use the CardView tag on XAML, is not finding it. Has to do something more than install ?

Getting TypeInitializationException

Trying to upgrade my app to Prism v7 (preview 3), Xamarin.Forms 2.5.0.121934, and CardView 1.1.1.1.

When I try to navigate to a form containing some cardview controls on it, I am getting this error:

At the time of the exception, the container was: 
[mono-rt]   Resolving StormFueling.Views.StormFuelingPage,StormFuelingPage (mapped from System.Object, StormFuelingPage)
[mono-rt]   Calling constructor StormFueling.Views.StormFuelingPage()
[mono-rt]  ---> System.TypeInitializationException: The type initializer for 'CardView.CardView' threw an exception. ---> System.ArgumentException: Default value did not match return type
[mono-rt] Parameter name: defaultValue
[mono-rt]   at Xamarin.Forms.BindableProperty..ctor (System.String propertyName, System.Type returnType, System.Type declaringType, System.Object defaultValue, Xamarin.Forms.BindingMode defaultBindingMode, Xamarin.Forms.BindableProperty+ValidateValueDelegate validateValue, Xamarin.Forms.BindableProperty+BindingPropertyChangedDelegate propertyChanged, Xamarin.Forms.BindableProperty+BindingPropertyChangingDelegate propertyChanging, Xamarin.Forms.BindableProperty+CoerceValueDelegate coerceValue, Xamarin.Forms.BindableProperty+BindablePropertyBindingChanging bindingChanging, System.Boolean isReadOnly, Xamarin.Forms.BindableProperty+CreateDefaultValueDelegate defaultValueCreator) [0x0008a] in D:\agent\_work\1\s\Xamarin.Forms.Core\BindableProperty.cs:74 
[mono-rt]   at Xamarin.Forms.BindableProperty.Create (System.String propertyName, System.Type returnType, System.Type declaringType, System.Object defaultValue, Xamarin.Forms.BindingMode defaultBindingMode, Xamarin.Forms.BindableProperty+ValidateValueDelegate validateValue, Xamarin.Forms.BindableProperty+BindingPropertyChangedDelegate propertyChanged, Xamarin.Forms.BindableProperty+BindingPropertyChangingDelegate propertyChanging, Xamarin.Forms.BindableProperty+CoerceValueDelegate coerceValue, Xamarin.Forms.BindableProperty+CreateDefaultValueDelegate defaultValueCreator) [0x00000] in D:\agent\_work\1\s\Xamarin.Forms.Core\BindableProperty.cs:132 
[mono-rt]   at CardView.CardView..cctor () [0x00073] in <1f7204124e6c4b1e9064b0989c5a1a9e>:0 

The XAML I am using to set up a cardview looks like this:

                <cv:CardView CardViewOutlineColor="Black"
                    CardViewHasShadow="true"
                    Grid.Row="0"
                    Grid.Column="0">

                    <cv:CardView.HeightRequest>
                        <OnPlatform x:TypeArguments="x:Double">
							<On Platform="Android" Value="213" />
							<On Platform="iOS" Value="203" />
						</OnPlatform>
                    </cv:CardView.HeightRequest>

                    <cv:CardView.Margin>
                        <OnPlatform x:TypeArguments="Thickness">
							<On Platform="iOS" Value="0,0,0,4" />
						</OnPlatform>
                    </cv:CardView.Margin>

                    <cv:CardView.GestureRecognizers>
                        <TapGestureRecognizer NumberOfTapsRequired="1"
                            Command="{Binding ContractorFuelingCommand}" />
                    </cv:CardView.GestureRecognizers>

                    <cv:CardView.CardViewContent>

                        <Grid HorizontalOptions="FillAndExpand"
                            VerticalOptions="Start"
                            BackgroundColor="White">

                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>

                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="40" />
                            </Grid.RowDefinitions>

                            <Image Source="contractor_fuel_card.png"
                                Aspect="AspectFill"
                                Grid.Row="0"
                                Grid.Column="0" />

                            <Label Text="Contractor Fueling"
                                HorizontalOptions="Start"
                                VerticalOptions="End"
                                FontSize="Large"
                                TextColor="White"
                                Margin="16, 0, 16, 8"
                                Grid.Row="0"
                                Grid.Column="0" />

                            <controls:FlatButton HorizontalOptions="Start"
                                BackgroundColor="Transparent"
                                VerticalOptions="End"
                                HeightRequest="40"
                                Text="START"
                                TextColor="{StaticResource bizRed}"
                                Grid.Row="1"
                                Grid.Column="0">
								<controls:FlatButton.Margin>
									<OnPlatform x:TypeArguments="Thickness">
										<On Platform="iOS" Value="8,0,0,0" />
									</OnPlatform>
								</controls:FlatButton.Margin>
							</controls:FlatButton>

                        </Grid>
                    </cv:CardView.CardViewContent>

                </cv:CardView>

Any ideas why I might be getting this all of a sudden? I am trying to run on an Android emulator with API23.

Thanks

[Enhancement] CoverFlow Possibility to show 3 items or more at same time.

Description

It would be great to have the possibility to get a kind of Cover Flow that show more than one element at a time.

Expected Behavior

  • Carousel could become a CoverFlow control that show more than one items at same time.
  • In a second time we could manage some flow animations.

Actual Behavior

CardsView & CarouselView are Awesome.
But Carousel don't accept any items pre-visualisation on both side (left & right).

Basic Information

  • Xamarin.Forms: 3.1.0.697729
    • Android: 8.1

CardView Shadow

CardView Shadow is not displaying on Android Device.

Here is the segment of code

<cardView:CardView
CardViewHasShadow="true"
BackgroundColor="#cfddeb"
HeightRequest="265"
>
.......

Not compatible with .NET Standard 2.0

Getting the an error message when I try out the example XAML code.

<CardView> <CardView.CardViewContent> <StackLayout> <Label Text="Label inside StackLayout forming the CardViewContent"></Label> </StackLayout> </CardView.CardViewContent> </CardView>

Type CardView not found in xmlns http://xamarin.com/schemas/2014/forms

I believe this error is being caused by the incompatibility, since Visual Studio is having to revert the package to the .NET Framework, instead of using .NET Standard

Corner Radius

Hi there,

It would be great if added feature to set corner radius. So it will beautify the view.

System.Reflection.TargetInvocationException has been thrown

<ContentPage Title="Regional" xmlns:local="clr-namespace:TechTV" xmlns:cv="clr-namespace:CardView;assembly=CardView" xmlns:syncfusion="clr-namespace:Syncfusion.SfRotator.XForms;assembly=Syncfusion.SfRotator.XForms" xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="TechTV.RegionalPage">
<ContentPage.Content>


<syncfusion:SfRotator x:Name="rotator" NavigationStripMode="Dots" EnableAutoPlay="true" EnableLooping="true" NavigationDirection="Horizontal" NavigationDelay="4000" NavigationStripPosition="Bottom" DotPlacement="OutSide" />
<cv:CardView CardViewHeightRequest="100" CardViewOutlineColor="Gray" CardViewOutlineColorThickness="2" CardViewHasShadow="True">
cv:CardView.CardViewContent




</cv:CardView.CardViewContent>
</cv:CardView>


</ContentPage.Content>

How to change xfsCard border color in IOS. Currently it shows reddish. How to chnage this??

Issue Template

In order to submit an issue, please follow the guidelines in this template.

First of all, in case you didn't search for the issue you faced in the Issues page, please make sure to do it here.
No one knows, you might already find the issue mentioned before with a solution given.
If you don't find it, then please proceed with the next steps.

  • Describing the problem.

In order to better understand your problem, please describe it clearly and try to narrow it down as much as possible.

  • Exception

Make sure to include the exception being thrown if any.

  • No Exception?

If there's no exception, but you're facing a problem with an undesired behaviour or design, please include the next:

  1. Explain what are you trying to achieve.
  2. What is your current output.
  3. What is your desired output.
  • Code Snippets.

If you believe you know exactly where the error is being thrown in your code, include it.

  • Demo App.

Make sure to include a demo application that reproduce the problem exactly as it is in order to investigate it and fix it.

Those are simple rules that I would like you all to follow, they might be edited through the time in a better format.

Please note, issues following these rules will be treated in a higher priority than other issues.

Default width and height request

Hi there,

I just found some issue in this module related for Height Request and Width Request.
By default this module given match_parent value like in Android for Height Request and Width Request.
It's bother when we want to use warp_content value like in Android for Height Request and Width Request.
But when i use the following approach it's fine

<cardView:CardView
	CardViewHeightRequest="-1"
	HorizontalOptions="Start">
    <cardView:CardView.CardViewContent>
        <StackLayout Orientation="Vertical">
            <Label Text="What about an image?"></Label>
            <Image Source="icon.png"></Image>
        </StackLayout>
    </cardView:CardView.CardViewContent>
</cardView:CardView>

i only added CardViewHeightRequest="-1" and HorizontalOptions="Start".

When i see the source code in CardViewHeightRequestProperty section please change the default value from 300 become -1 and set HorizontalOptions default value to Start.

Thanks,
Cahyo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.