0

This is a general question and specific one. For general purpose - to understand how XF works and specifically - for using in my custom controls.

So, the thing is that I should put the elements (generated by XF for specific system (iOS or Android)) into some custom place within custom renderer.

In a nutshell, it's embedding XF controls into native interface, in more details I need to put the controls into custom alert/popup. The issue is that the final size of the elements (views) can be different from initially generated XF ones. So I need further adjustment of them (for instance, to fit parent view bounds (as again, the parent size is custom one and usually platform-dependent and screen-size-dependent)).

Let's say, I have:

    <controls:AlertPanel 
        HorizontalOptions="FillAndExpand"
        VerticalOptions="FillAndExpand">

where AlertPanel is:

    public class AlertPanel : Frame

inside of the custom renderer (of the AlertPanel for iOS):

    // container is my native (manually created) view
    container.AddSubview(this); 

and this is the renderer class (inherited basically from UIView).

But if I do this right on IsVisible attribute setting to true (and the whole UI control block is dynamically created (or at least positioned)), the bounds setup via:

    this.Frame = new CGRect(...);

... doesn't quite properly reflect what I expect.

It's much better when I apply that after (for instance) 10 ms delay, however, this is neither nice approach, nor having clear understanding of which way this all works.

In addition, I haven't found any constrains applied to the view generated by XF, so I am considering the bounds are strictly defined or calculated dynamically.

Any clues?

Agat
  • 4,577
  • 2
  • 34
  • 62
  • Where do you place the `container`? You want the XF's controls wrapped by the `container`? You'd better share a sample to help us understand your requirements and reproduce your issues. – Ax1le Apr 09 '18 at 09:55
  • Thanks for the answer, but I've already provided the details. I cannot have the XF in place, and the way I wrap it is above: `container.AddSubview(this);`, where `container` is any other (my custom) UIView. – Agat Apr 09 '18 at 11:26

0 Answers0