Help converting Android to iOS custom renderer

WilliamWattersonWilliamWatterson USUniversity ✭✭

Hi,

I have a custom renderer in Android which returns a relative layout. I want to do the same in iOS but I cant seem to get it to work.

Here is my Android code:

    //create a linear layout to hold the - button, the temp label and the + button
            LinearLayout linearLayout = new LinearLayout(this.Context);
            linearLayout.Orientation = Orientation.Horizontal;
            linearLayout.AddView(btnDecrease);
            linearLayout.AddView(lblTemperatureValue);
            linearLayout.AddView(btnIncrease);

            //align the linear layout to the centre of the relative layout we will be returning
            Android.Widget.RelativeLayout.LayoutParams rlp = new Android.Widget.RelativeLayout.LayoutParams(
            Android.Widget.RelativeLayout.LayoutParams.WrapContent,
            Android.Widget.RelativeLayout.LayoutParams.WrapContent);
            rlp.AddRule(LayoutRules.CenterInParent);
            linearLayout.LayoutParameters = rlp;

            Android.Widget.RelativeLayout layoutToReturn = new Android.Widget.RelativeLayout(this.Context);
            layoutToReturn.AddView(radRadialGaugeView);
            layoutToReturn.AddView(linearLayout);

            //replace the original control with our custom conrol (relative layout)
            SetNativeControl(layoutToReturn);

Is there any way I can do this in iOS too? I cant seem to find a relative layout native control I can return. Please help...

Thanks

Sign In or Register to comment.