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

Control only on one platform - XAML and OnPlatform

$
0
0

I want to add label (or other element) only on one platform, how achieve that using XAML? I tried:

<OnPlatform x:TypeArguments="View">
  <OnPlatform.WinPhone>
    <Label Text="Only on WinPhone"></Label>
  </OnPlatform.WinPhone>
</OnPlatform>

but it throws exception. I guess I could use visibility and set false on every platform, but one, but maybe there is more elegant way.


Viewing all articles
Browse latest Browse all 77050

Latest Images

Trending Articles



Latest Images

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