Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Android Custom Renderer And Element / Native Control Lifecycle

$
0
0

Hi All

I am creating a custom control in Forms / Android and have a custom renderer.

I am setting the native control in the OnElementChanged to a RelativeLayout, where I have added child controls to the relative layout.

However, I need to be able to tap into the rendering lifecycle at some appropriate point because one of the child controls in my relative layout needs to be re-drawn every time the size changes.

However, if I tap into the SizeCanged or MeasureInvalidated events on the Forms.View, the size of the Control element of the view (my RelativeLayout) is allways 0.

However, if I cause some delay in my logic, the sizing is correct, so logic suggests I need to tap into a lifecycle event further down the layout pass.

Any ideas ?

Dean


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>