How can i do a fill animation in Xamarin.Forms - animation

I need to fill up an polygon with Xamarin.Forms. Imagine a square and fill it with some color with animation.

The easiest thing you can do is to use a BoxView view with Opacity set to zero and Color set to your desired color. Then do the animation with yourBoxView.FadeTo or yourBoxView.TranslateTo method.
If you need a border you have to make a custom render for a ContentView with border support and then put your BoxView inside it or you can use FrameView (rounded corners). http://developer.xamarin.com/guides/cross-platform/xamarin-forms/custom-renderer/
This does something very similar: https://www.youtube.com/watch?feature=player_embedded&v=55r1wHdOLBo

Related

Scrollview Viewport Mask not hiding content

Here is a screenshot of my scene:
I'd like to have a grid of prefabs which I can scroll through. The grid works and the scrolling works, but the mask on the viewport does not hide the content. I've tried selecting/deselecting the "Show Mask Graphic" option, I've tried using a Rect Mask 2D instead and in addition, and I've tried putting mask components on the ScrollView itself. I'm at a bit of a loss for what to do.
How can I prevent the content from appearing if it is not within the viewport? Here are some screenshots of the scene objects' inspector properties:
ScrollView:
ViewPort:
Content:
GameObject Prefab:
Because those are Sprites, not UI.Images
The Unity UI Mask object can only mask other UI elements. Sprite is not one of those. You should change your prefab to have an UI.Image component instead.

How to "tint" UIVisualEffectView on iOS 8+? Or, create a blurred background view with a tint color?

Self-explanatory. UIVisualEffectView only has a light, dark, and "extra light" tint variation. Is there a way to tint with a color instead, such as the tint color of the app?
UINavigationBar sort of does this, I think, in that it has transparency and blur... but also a tint color.
Third-party libraries are OK, but I'm not sure where to look for this.
You can tint the UIVisualEffectView using this library:
https://github.com/efremidze/VisualEffectView
Set a UIView with an alpha of 0.5 or so with a background color. In front of that put a UIVisualEffectView. Remember to not set the visual effect view as a subview of the first background view.
That should do the trick.
It seems like FXBlurView is the way to go currently for tinted blurs. https://github.com/nicklockwood/FXBlurView
You could maybe put it in a UIView that had a semi-opaque background color of the opacity to your liking...

Force widget painting on contentsRect instead of rect

I'm setting contentsMargins for widget and want widget to be painted on contentsRect() instead of rect(). I can do so at paintEvent by setting viewPort and clipRegion, but I don't want to implement paintEvent for every type of widget.
Is it possible to force widget painting on contentsRect instead of rect?
I'm writing analog of mimic creator and want to draw border over each visual component. Just like it's done in Qt creator - when I pick widget at design window, there is a border with resizing points over each widget and I want such border.
Solved. I just created sibling border class for each visual component, implemented moved and resized slots for it so that border resized along with widget, and called stackUnder for each widget so that border painted over each widget. Thanks for collaboration.

changing the color of the button in selectfield/datepicker/timepicker in Sencha

Is it possible to change the color of the button (the little triangle button) shown in the right side of selectfield/datepicker/timepicker?
those little triangles are constructed using images as background so you need to change those images to change color of those triangles
for datepicker image is "resources/themes/images/default/form/date-trigger.gif" in css class .x-form-date-trigger
for timepicker/selectfield image is "resources/themes/images/default/form/trigger.gif" in css class .x-form-trigger

Does strokeRect: of NSBezierPath always draw a transparent rect? (Cocoa OSX)

I am trying to make a custom selection box for an image view I created and I am trying to use strokeRect: from NSBezierPath but it always seems to be transparent. Called the method set to set the color the blackColor and then also tried using olorWithDeviceRed:green:blue:alpha: but no matter what I have tried the rectangle created always seems to be transparent. Is there a better method to use to draw an empty rectangle?
Are you seeing the boundaries of your strokeRect:?
All +strokeRect: does is draw the outside edge defined by the rect. If you want to fill that rect as well you would need to call [NSBezierPath fillRect:rect]. In this case it will use the current fill color. Calling -set on a color sets the stroke and fill color but if you want to set it individually you'd call -setFill on your color object.

Resources