vincentgury / xfshapeview Goto Github PK
View Code? Open in Web Editor NEWCreate shapes content views from shared code for your mobile apps!
License: MIT License
Create shapes content views from shared code for your mobile apps!
License: MIT License
not a big issue... just thought you'd like to know
Is it possible to animate drawing the circle ? I want a label and a the outer circle would be animated while drawing (think of a percentage).
Can we get the library updated? Thanks!
Based on the ReadMe.md there is no call for any Init(); but it seems that there should be one because the mono droid cannot load the 'XFShapeView.Droid.ShapeRenderer', or is there any other cause for this error:
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'XFShapeView.Droid.ShapeRenderer' from assembly 'XFShapeView.Droid, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
My Environment is:
On iOS there is no error but no view either.
My ShapeView Implementation:
var simpleCircle = new ShapeView()
{
ShapeType = ShapeType.Circle,
HeightRequest = 75,
MinimumHeightRequest = 50,
WidthRequest = 75,
MinimumWidthRequest = 50,
Color = Color.White,
BorderColor = Color.White,
Content = new Label
{
Text = "Dummy Text",
TextColor = Color.White,
FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label)),
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
HorizontalTextAlignment = TextAlignment.Center,
VerticalTextAlignment = TextAlignment.Center
}
};
Hello.
I have a complex Path shape to create a "border path" with an empty zone in the middle of the shape.
For example (points):
[0,0]
[100,0]
[100,100]
[0,100]
[0,0]
[10,10]
[10,90]
[90,90]
[90,10]
[10,10]
If I set BackgroundColor = Transparent and Opacity = 0.5 to the ShapeView the background is rendered as Black instead of Transparent.
My workaround is to set Opacity = 1 and change the alpha channel of the Color (fill), for example #aa000000 (for a transparent black), but I think that previous indicated behaviour is an issue.
Here is the xaml I'm using
<xfShapeView:ShapeView ShapeType="ProgressCircle" Opacity=".75" Progress="{Binding UploadProgress}" IsVisible="{Binding ShowProgress}" BorderColor="Transparent" BorderWidth="7" Color="Transparent" ProgressBorderColor="White" ProgressBorderWidth="5" AbsoluteLayout.LayoutBounds=".5,.5,.5,.5" AbsoluteLayout.LayoutFlags="All">
This works great on Android, but nothing renders on iOS (I tried 9.3 and 10).
I'm a missing an Init() call maybe? Didn't notice any special requirements.
Hello.
Do you think it's possible to insert an option to have a NOT-rounded progress border on Android (like on iOS).
Thanks for your great library!
Thanks for awesome plugin to to draw some custom shapes, it is really cool. I have tested on Android, but unable to test it on iOS , because Init function is not available in iOS, I checked the implementation, the function is defined in iOS project as a Static Method, but not available when I try to use it throught Nuget package manager. I will be nice if you could fix this issue. or am I missing some setup?
Hi there!
I am trying to get this great package working in my xaml.
I created the control like this:
<ContentPage xmlns:shape="clr-namespace:XFShapeView;assembly=XFShapeView">
Then, I create this:
<shape:ShapeView x:Name="shp">
<shape:ShapeView.Content>
<controls:ImageButton x:Name="TwitterButton"
BackgroundColor="#335465"
HeightRequest="75"
ImageHeightRequest="50"
ImageWidthRequest="50"
Orientation="ImageOnTop"
Text="Lijst"
TextColor="#ffffff"
FontFamily="Sansa"
>
<controls:ImageButton.Source>
<FileImageSource File="notebook.png" />
</controls:ImageButton.Source>
</controls:ImageButton>
</shape:ShapeView.Content>
</shape:ShapeView>
But I see my own ImageButton, but not the shape around it. What am I doing wrong?
Hi friend, how do I make progress not be on the border of the shape if not in the background color?, that if the progress is 50%, just the background color to be half
Sorry for my english
I tried a few ways to update the Text on the Content, event set Binding to a value and it doesn't update. Am I doing something incorrect or this doesn't work?
Hi there,
Plugin is throwing excpetion when calling the Init() method from the AppDelegate file on app launch - iOS:
2019-09-24 11:07:06.490 MyApp.iOS[588:149395] Unhandled managed exception: Exception has been thrown by the target of an invocation. (System.Reflection.TargetInvocationException)
at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00018] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:944
at System.Reflection.RuntimeConstructorInfo.DoInvoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00086] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:926
at System.Reflection.RuntimeConstructorInfo.Invoke (System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globali
zation.CultureInfo culture) [0x00000] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:960
at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x00000] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/corefx/src/Common/src/CoreLib/System/Reflection/ConstructorInfo.cs:22
at ObjCRuntime.Runtime.ConstructNSObject[T] (System.IntPtr ptr, System.Type type, ObjCRuntime.Runtime+MissingCtorResolution missingCtorResolution) [0x0003b] in <1b20576ce73640d782f136af13e79af3>:0
at ObjCRuntime.Runtime.GetNSObject[T] (System.IntPtr ptr) [0x000d1] in <1b20576ce73640d782f136af13e79af3>:0
at UIKit.UIKeyCommand.Create (Foundation.NSString keyCommandInput, UIKit.UIKeyModifierFlags modifierFlags, ObjCRuntime.Selector action) [0x0003b] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.2.0.42/src/Xamarin.iOS/UIKeyCommand.g.cs:107
at Xamarin.Forms.Platform.iOS.Visual
ElementRenderer`1[TElement]..ctor () [0x00043] in <4e367b2cd46d4a02b980ea2aa2a1115b>:0
at XFShapeView.iOS.ShapeRenderer..ctor () [0x00000] in E:\Projets\GitHub\XFShapeView\src\XFShapeView.iOS\ShapeRenderer.cs:41
at XFShapeView.iOS.ShapeRenderer.Init () [0x00000] in E:\Projets\GitHub\XFShapeView\src\XFShapeView.iOS\ShapeRenderer.cs:48
at MyApp.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication uiApplication, Foundation.NSDictionary launchOptions) [0x000bd] in C:\Users\Admin\Apps\MyApp\MyApp\MyApp.iOS\AppDelegate.cs:60
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.2.0.42/src/Xamarin.iOS/UIKit/UIApplication.cs:86
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [
0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.2.0.42/src/Xamarin.iOS/UIKit/UIApplication.cs:65
at MyApp.iOS.Application.Main (System.String[] args) [0x00001] in C:\Users\Admin\Apps\MyApp\MyApp\MyApp.iOS\Main.cs:18
--- inner exception ---
This API is not supported on this version of iOS (System.PlatformNotSupportedException)
at UIKit.UIMenuElement..ctor (System.IntPtr handle) [0x00007] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.2.0.42/src/Xamarin.iOS/UIMenuElement.g.cs:91
at UIKit.UICommand..ctor (System.IntPtr handle) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.2.0.42/src/Xamarin.iOS/UICommand.g.cs:88
at UIKit.UIKeyCommand..ctor (System.IntPtr handle) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.2.0.42/src/Xamarin.iOS/UIKeyCommand.g.cs:91
at (wrapper managed-to-native) System.Reflection.RuntimeConstructorInfo.InternalInvoke(System.Reflection.RuntimeConstructorInfo,obje
ct,object[],System.Exception&)
at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00005] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:936
Plugin version of Xamarin Forms is: 4.2.0.815419
Plugin version of ShapeView is: 1.0.5
Was previously working prior to this version of XF
See Resharper or a similar tool to understand why you cannot use the method name Init with "new". This means that you are blocking the initialization of a lower-level method.
Just rename it to InitializeShapeRenderer or something like that. It's more clear anyway.
Hi Guys,
I have a custom Cell for a List view
I have a Circle, but only displays as square, can someone Help?
TIA.
Label lbl_Init = new Label
{
FontAttributes = FontAttributes.Bold,
FontSize = Device.GetNamedSize(NamedSize.Large,typeof(Label)),
TextColor=Color.White,
HorizontalOptions = LayoutOptions.Fill,
VerticalOptions = LayoutOptions.Fill,
VerticalTextAlignment = TextAlignment.Center,
HorizontalTextAlignment = TextAlignment.Center,
};
lbl_Init.SetBinding(Label.TextProperty, new Binding("FullName", BindingMode.Default, new NameInitConverter(), null));
sv = new ShapeView {
ShapeType = ShapeType.Circle,
Content = lbl_Init,
HeightRequest = 50,
WidthRequest = 50,
BackgroundColor = Color.LightGray
};
**Edit - I've actually just confirmed I'm able to see the circle render on physical iOS devices when connected in debug mode, just not when I've installed the adhoc build.
I'm using a shapeview to draw a simple circle in a Xamarin Forms application. It's defined in Xaml and bound to a property in my VM using a value converter (enum -> color). This works fine on android (devices and emulators), and fine in the iOS emulators, but I see nothing on actual iOS devices.
<shapes:ShapeView x:Name="rarityCircle"
HorizontalOptions="End" VerticalOptions="Start"
ShapeType="Circle"
BorderColor="White" BorderWidth="2"
Opacity=".7"
Margin="5"
HeightRequest="20" WidthRequest="20"
Color="{Binding Rarity, Converter={StaticResource Key=RarityColor}}}"/>
Is it possible to use this in Xaml code? I tried but couldn't find the right namespace.
I have list with items and in every item I have circle shape with image content:
<StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" BackgroundColor="White" Orientation="Vertical"> <xfShapeView:ShapeView x:Name="StepOneNumber" ShapeType="Circle" HeightRequest="48" WidthRequest="48" Color="{Binding IconBackgroundColorCode}" VerticalOptions="CenterAndExpand" HorizontalOptions="StartAndExpand" Margin="5, 0, 0, 0"> <xfShapeView:ShapeView.Content> <Image Source="{Binding IconUrl}" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" WidthRequest="32" HeightRequest="32" /> </xfShapeView:ShapeView.Content> </xfShapeView:ShapeView> </StackLayout>
When I change image on server and pull list to refresh it's ok, images are updated, but if I change color on server, color in circle around image doesn't update. Also if I pull list to refresh several times in short period, colors get mess up some times.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.