XAML常用語法

OnPlatform

         <Image HeightRequest="30" WidthRequest="30" >
          <Image.Source>
            <OnPlatform x:TypeArguments="x:String">
              <OnPlatform.iOS>Icon.png</OnPlatform.iOS>
              <OnPlatform.Android>icon.png</OnPlatform.Android>
            </OnPlatform>
          </Image.Source>
        </Image>

找符號(characters)呈現在page上

找到符號對應的英文名
找到utf8之編碼 所有的符號表 | 符號表2

邊界的定義,Andorid 跟 iOS在top edge 有不同的定義

   <ContentPage.Padding>
        <OnPlatform x:TypeArguments="Thickness"
                    iOS="5, 20, 0, 0"
                    Android="5, 0, 0, 0"
                    WinPhone="5, 0, 0, 0" />
    </ContentPage.Padding>
     <StackLayout>
            <StackLayout.Padding>
                <OnPlatform x:TypeArguments="Thickness"
                            iOS="0, 20, 0, 0" />
            </StackLayout.Padding>
<Image HeightRequest="30" WidthRequest="30" >
          <Image.Source>
            <OnPlatform x:TypeArguments="ImageSource"
                      Android="icon.png" iOS="Icon.png">
            </OnPlatform>   
          </Image.Source>

        </Image>

https://developer.xamarin.com/guides/xamarin-forms/user-interface/text/fonts/

results matching ""

    No results matching ""