entry, editor

main
syneffort 2 years ago
parent df76ec4c77
commit 206740eb9a
  1. 5
      XamarinStudy/XamarinStudy/XamarinStudy/Views/SampleElementPage1.xaml
  2. 19
      XamarinStudy/XamarinStudy/XamarinStudy/Views/SampleElementPage2.cs

@ -12,6 +12,11 @@
<Label Text="This is Lable" TextColor="DarkSlateBlue" BackgroundColor="LightPink" FontSize="Large" FontAttributes="Bold" HorizontalTextAlignment="Start"/>
<Label Text="This is Lable" TextColor="DarkSlateBlue" BackgroundColor="LightPink" FontSize="Large" FontAttributes="Italic" HorizontalTextAlignment="Center"/>
<Label Text="This is 30 Lable" TextColor="Red" BackgroundColor="LightPink" FontSize="30" HorizontalTextAlignment="Center"/>
<Entry Placeholder="Input Text" TextColor="Salmon" FontSize="Large" FontAttributes="Bold" Keyboard="Text"/>
<Entry Placeholder="Input Number" TextColor="Red" FontSize="Large" FontAttributes="Bold" Keyboard="Numeric"/>
<Editor Placeholder="Input Message" TextColor="Red" BackgroundColor="{OnPlatform Android=Blue,UWP=White}" FontSize="Large" FontAttributes="Bold" HeightRequest="250"/>
</StackLayout>
</ContentPage.Content>
</ContentPage>

@ -17,13 +17,30 @@ namespace XamarinStudy.Views
changeBackgroundColorButton.Clicked += ChangeBackgroundColorButton_Clicked;
Label label1 = new Label() { Text = "CS Label", TextColor = Color.Red, BackgroundColor = Color.DeepSkyBlue, FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)) };
Label label2 = new Label() { Text = "CS 20 Label", TextColor = Color.Red, BackgroundColor = Color.DeepSkyBlue, FontSize = 30 };
Editor editor = new Editor()
{
Placeholder = "Multi-line input",
HeightRequest = 300
};
if (Device.RuntimePlatform == Device.UWP)
{
editor.BackgroundColor = Color.White;
editor.TextColor = Color.Black;
}
else
{
editor.BackgroundColor = Color.Black;
editor.TextColor = Color.White;
}
Content = new StackLayout
{
Children =
{
changeBackgroundColorButton,
label1,
label2
label2,
editor
}
};
}

Loading…
Cancel
Save