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

How to instantiate xamarin android/ios native custom control class in xamarin forms xaml

$
0
0

Custom control class:

    public class CustomTextInput : UITextField
    {    
    }

Xamarin.Forms xaml:

  <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:Custom="clr-namespace:SampleApp.CustomControls;assembly=SampleApp"
             x:Name="SampleAppView">
<ContentPage.Content>            
    <StackLayout Orientation="Horizontal">
        <Image Source="Sample_ic.png" WidthRequest="29" HeightRequest="29"/>
        <StackLayout Orientation="Vertical">
            <Label Text="Sample Text" TextColor="#717073" FontSize="Small" FontFamily="Helvetica"/>         
            <!--Accessing IOS Custom control class-->
            <Custom:CustomTextInput Text="50 Gal"  BackgroundColor="Transparent" TextColor="#838288" />
        </StackLayout>  
    </StackLayout>
</ContentPage.Content>
</ContentPage>          

Can I access android/IOS custom control class in xamarin.forms xaml? For sample I used UITextField control. But I need to access android/IOS platform specific custom controls which is not available in xamarin.forms.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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