3/23/2023 0 Comments Paintcode for android![]() ![]() I am having some issues with getting the view to layout correctly in IOS. ![]() 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 have code that sets the bindable WidthAndHeight property on the PCL view after i find out the dimensions on the screen. I have tried all manner of methods to get the view in IOS to size correctly. I have tried updating the Control.Bounds, Control.Frame, TheButton.Frame, TheButton.Bounds but nothings gets the view to resize. I have set a break point and it appears as if the values are get set but then nothing is updated. 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. 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. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |