Using Xamarin.Forms, how would I achieve the following angled background without using an image:
相关问题
- Xamarin. The name 'authorEntry does not exist
- How to implement only emoji keyboard for Entry?
- Error:Xamarin.Forms targets have been imported mul
- Store data and global variables using the Applicat
- How to change default background color for TChromi
相关文章
- Xamarin form MessagingCenter Unsubscribe is not wo
- Reload data on tab selected in a fragment using vi
- The type initializer for 'SQLite.SQLiteConnect
- What to use for AttributeName in Xamarin Mac
- Start an Activity from another Activity on Xamarin
- Xamarin build error: defining a default interface
- Xamarin Android Player Error when attempting to fi
- How to change the Back Button Text on Xamarin.Form
A 100%
Xamarin.Forms
with no "custom renderer" involved solution:In the example below, the solid blue portion of the semi-transparent box behind the
Labels
on the screen is aNControl
, you can also do gradients, simple animations, etc... but in this case just a solid polygon is being drawn within a semi-transperent rectangle:Using
NGraphics
viaNControl
you can do a lot in terms of drawing custom controls inXamarin.Forms
without custom renderers. It is not a solution in every use-case, but its clean and works cross-platform (iOS/Android/WinPhone).Rendered in
Red
with a heavier alpha setting so you can see the control better:This control is embedded in an
AbsoluteLayout
that uses dynamic bounds so even orientation changes are handled cleanly:https://github.com/praeclarum/NGraphics
https://github.com/chrfalch/NControl
There is no way to define a gradient in Xamarin Forms. Your best bet would be to use an image. However, you could also try writing a custom renderer that used the underlying platform API to draw a gradient background.
Here is a thread that discusses using the custom renderer approach.