title: Xamarin.Forms: How to properly use <OnPlatform> to pick which control to use in my TableSection?
body: <p>I have a <code>TableView</code> with few sections. In my <code>TableSection</code> I want to display different controls depending on the platform. I want to use the usual <code>TextCell</code> for iOS and a custom <code>ViewCell</code> for Android. I have tried the following code:</p>
  
  <pre><code>&lt;TableSection Title="Activity"&gt;
     &lt;OnPlatform x:TypeArguments="View"&gt;
        &lt;On Platform="iOS"&gt;
           &lt;TextCell x:Name="btnCountIOS" Text="Count" Height="50" /&gt;
           &lt;TextCell x:Name="cardHistory" Text="History" StyleId="disclosure" Tapped="openHistoryPage" Height="50"/&gt;
        &lt;/On&gt;
        &lt;On Platform="Android"&gt;
           &lt;local:MyViewCell NoTap="true" Height="50"&gt;
              &lt;Grid VerticalOptions="CenterAndExpand" Padding="20, 0"&gt;
                 &lt;Label Style="{DynamicResource ListItemTextStyle}" HorizontalOptions="StartAndExpand" VerticalOptions="Center" Text="Today" /&gt;
                 &lt;Label Style="{DynamicResource ListItemTextStyle}" TextColor="Gray" HorizontalOptions="End" x:Name="btnCountDroid" /&gt;
              &lt;/Grid&gt;
           &lt;/local:MyViewCell&gt;
           &lt;local:MyViewCell&gt;
              &lt;!-- more code here --&gt;
           &lt;/local:MyViewCell&gt;
        &lt;/On&gt;
     &lt;/OnPlatform&gt;
  &lt;/TableSection&gt;
  </code></pre>
  
  <p>The above code does not work. It gives me an error: <code>Object reference not set to an instance of an object</code>.</p>
  
  <p>Am I missing something? Should I be using a different <code>x:TypeArguments</code>?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Edited to incorporate @Fahadsk answer and now getting the error: <code>System.ArrayTypeMismatchException: Attempted to access an element as a type incompatible with the array.</code> Anyone knows why I'm getting this? </p>