Int widthDp = (int)Math.Round(senderasBTN.WidthAndHeight * pixelsPerOneDp) Var param = ĭouble pixelsPerOneDp = (double)((int).DensityDpi / 160f) HexagonButtonForms senderasBTN = (HexagonButtonForms)sender change the width and height to the value of senderAsAButton.WidthAndHeight.Ĭlass HexagonButtonRendererAndroid: ViewRendererīase.OnElementPropert圜hanged(sender, e) if (Control = null || Element = null) HexagonButtonForms senderAsAButton = (HexagonButtonForms)sender If (string.Equals("WidthAndHeight", e.PropertyName)) Protected override void OnElementPropert圜hanged(object sender, Propert圜hangedEventArgs e)īase.OnElementPropert圜hanged(sender, e) HexagonButtonIOS TheButton protected override void OnElementChanged(ElementChangedEventArgs e) } public HexagonButtonIOS(RectangleF bounds) : base(bounds)Ĭlass HexagonButtonRendererIOS: ViewRenderer I havent done anything other than change the background so that i can see the view on the screen.
Paintcode android android#
I have included the Android renderer as an example of exactly what I am doing there to set the view size correctly on that platform. I have set a break point and it appears as if the values are get set but then nothing is updated. I have tried updating the Control.Bounds, Control.Frame, TheButton.Frame, TheButton.Bounds but nothings gets the view to resize. I have tried all manner of methods to get the view in IOS to size correctly.
Paintcode android code#
I have code that sets the bindable WidthAndHeight property on the PCL view after i find out the dimensions on the screen. I am creating a button that uses an SVG as a background (xam.svg on android and Mntone.SvgForXaml on UWP is what i use to get the SVG to actually display and paintcode is what I will use for IOS). I am having some issues with getting the view to layout correctly in IOS. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.I have a custom view in my PCL and I have built custom renderers on UWP, IOS and Android to render this view.
You can use the samples browser to select, preview, and import one or more sample appsĪs projects.
Paintcode android how to#
This page describes how to access and use the high-quality, Google-provided Android code samples. Use templates to create new app modules, individual activities, or other specific Android project
Browse sample code to learn how to build different components for your applications. Android Studio provides a selection of code samples and templates for you to use to accelerate yourĪpp development.