Comments (11)
When is this going to be released?
from xamarin.forms.
This issue is still very much a thing. Any updates?
from xamarin.forms.
CarView has no property to change the color of this border. You have to use a GradientDrawable in background. I can fix this bug if you wish.
from xamarin.forms.
Looking at https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Platform.Android/Renderers/FrameRenderer.cs#L53 UpdateBackground()
and UpdateCornerRadius()
are being called but both do same thing:
void UpdateBackground()
{
this.SetBackground(new FrameDrawable(Element, Context.ToPixels));
}
void UpdateCornerRadius()
{
this.SetBackground(new FrameDrawable(Element, Context.ToPixels));
}
This ends up in calling SetBackground
and creating FrameDrawable twice.
This hurts performance and it should be necessary...
Another thing: in the FrameDrawable
ctor, I see subscription to the PropertyChanged
event of the Xamarin.Forms.Frame
instance. I can't see where it's unsubscribing from the event. I haven't though if it's really needed it or not though.
from xamarin.forms.
Still got this issue on Android
_FrameLayout = new Frame
{
Padding = 20,
Margin = 10,
BackgroundColor = Color.White,
Content = View,
HasShadow = true,
OutlineColor = Color.Red,
VerticalOptions = LayoutOptions.CenterAndExpand,
HorizontalOptions = LayoutOptions.Center
};
from xamarin.forms.
@Clovs What version of Xamarin Forms do you use?
from xamarin.forms.
Hello,
"Xamarin.Forms" version="2.5.0.280555" targetFramework="xamarinios10"
You can see on source code here: https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Platform.Android/Renderers/FrameRenderer.cs
They use a BorderColor property from Frame Object,
But I got no one! @StephaneDelcroix
I just got an OutlineColor property. like describe in the doc:
https://developer.xamarin.com/api/type/Xamarin.Forms.Frame/
So I just redraw a stroke with OutlineColor property on the canvas with custom renderer:
Here my code:
public override void Draw(Canvas canvas)
{
base.Draw(canvas);
using (var strokePaint = new Paint())
using (var rect = new RectF(0, 0, canvas.Width, canvas.Height))
{
// stroke
strokePaint.SetStyle(Paint.Style.Stroke);
strokePaint.Color = Element.OutlineColor.ToAndroid();
strokePaint.StrokeWidth = 5;
canvas.DrawRoundRect(rect, Element.CornerRadius, Element.CornerRadius, strokePaint); // stroke
}
}
And Done!
but it still an issue, you can open it
Thanks,
from xamarin.forms.
This should be in 3.0.0
from xamarin.forms.
Hi! I'm still having issue with this on 3.2.0.839982 on Android - on iOS, Google Android simulators all ok - but on Android devices, Frame doesn't draw as expected. I use it to make a single pixel line - but on android devices it has only background. Fixed with a renderer
using Android.Content;
using Android.Graphics;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportRenderer(typeof(SeparatorLine), typeof(SeparatorLineRenderer))]
namespace TechPortal.Droid.Controls
{
public class SeparatorLineRenderer : FrameRenderer
{
public SeparatorLineRenderer(Context context) : base(context)
{
}
public override void Draw(Canvas canvas)
{
base.Draw(canvas);
if (Element == null || Element.BorderColor.A <= 0)
{
return;
}
using (var paint = new Paint
{
AntiAlias = true
})
using (var path = new Path())
using (Path.Direction direction = Path.Direction.Cw)
using (Paint.Style style = Paint.Style.Stroke)
using (var rect = new RectF(0, 0, canvas.Width, canvas.Height))
{
var raduis = Android.App.Application.Context.ToPixels(Element.CornerRadius);
path.AddRoundRect(rect, raduis, raduis, direction);
//paint.StrokeWidth = Context.Resources.DisplayMetrics.Density * 2;
paint.SetStyle(style);
paint.Color = Element.BorderColor.ToAndroid();
canvas.DrawPath(path, paint);
}
}
}
}
from xamarin.forms.
This is still an issue. I'm using Xamarin.Form 4.0.0425677
from xamarin.forms.
@D4rkC1own187 can you create a new issue and try the latest?
from xamarin.forms.
Related Issues (20)
- App freezes on Windows (UWP) when using Frame
- Cannot reload Listview datasource more than once, app close after error, Object reference not set to an instance of an object
- After installing the "Miicrosoft.UI.XAML" NuGet package on UWP platform. The Xamarin Button control style was changed. HOT 2
- [Bug] Xamarin.iOS application crashes on device with test flight version but not with DEBUG version HOT 4
- Unable to build Android custom renderers with latest Xamarin.Forms version HOT 1
- Xamarin Google.Map.MapView crash HOT 1
- [Bug] Missing a crucial warning in the NSMenu.Items documentation. HOT 1
- [Bug] App is frozen when resumed (Android) HOT 1
- UWP camera save option is disabled untill you edit capture picture. HOT 1
- [Bug] Archiving in VS 2022 failing HOT 3
- [Enhancement] Add more descriptive exception for route not found (Shell.Current.GoToAsync). HOT 2
- [Bug] Xamarin Splash screen not visible turns out black in iOS HOT 2
- [Bug] Entry looses focus
- [Bug] DisplayActionSheet doesn't show up on macOS
- [Bug] Letters below the writing line are cut off on iOS
- X2Property binding seems to be unfunctional in a carouselview
- [Bug] Xamarin.Forms v5.0.0.2662 has a package version conflict with itself HOT 5
- [Visual Studio 17.9.3] Xamarin project encountered an issue with xaml
- Get code in app from stack trace
- [Bug] In .Net 8 MAUI VisibleViews property of CarouselView is not working HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xamarin.forms.