Sunday 15 June 2014

c# - Beginner help for Xamarin ContentPage and or XAML Page -


I have just started my investigation and I'm checking how it works.

I would like to create a simple page with three lines of the following lines:

  1. The first row should be anchored on the top and will have a fixed width image and height (Like 264x70)
  2. The second line should have simple text
  3. The third line should anchor down and it will include two buttons that are vertical and horizontally centered.

I have tried to create this page directly with the code like:

  public sample page () {this.Padding = new thickness (10 , Device.onplayFormat (20, 0, 0), 10, 0); Var Homelogo = New Image () {Aspect = Aspects. Estimated;}; HomeLogo.Source = ImageSource.FromFile ("HomeLogo.png"); Var btn1 = new button () {text = "first button"}; Var BTN2 = New Button () {Text = "Second Button"}; this. Content = New Stack Layouts {Vertical Option = Layout Options. Center, horizontal option = layout options. Center, Orientation = Stack Orientation. Tactical, Children = {Home Logo, New Label {Vertical Ocean = Layout Options. Full and Expand, Text = "Ad is the best, best as best.}, BTN1, BTN 2}};}  

I am using Zaminin in Visual Studio and have created an XMarine Form Project using a Port class library. Is there a designer that I can use the UI

Try the following: I think you remember this fact For the ability to expand the parent container for the internal container, the same asset should also be set to expand

  this.Content = new StackLayout {verticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.Center, Orientation = Stackorientation .ctactical, kids = {home logo, new label {VerticalOptions = LayoutOptions.CenterAndExpand, Text = "is the best option for more players."}, BTN1, BTN 2}};  

No comments:

Post a Comment