本当にC#とXamarinフォームの新機能ですが、誰かが私に以下のコードの最後の行にエラーが表示される理由を説明してください。XamarinフォームのChildren.Add()
Visual Studioでは、このコードの最後の行にあるChildren
という単語に波線の赤い下線が表示されていますが、構文エラーがあることを示していますが、それはView
であるように、クラス....
var content = new ContentPage();
content.Title = "Appuler";
Label CompanyName = new Label();
CompanyName.HorizontalTextAlignment = TextAlignment.Center;
CompanyName.Text = "Test";
Button NextPage = new Button();
NextPage.Text = "Next Page";
NextPage.Font = Font.SystemFontOfSize(NamedSize.Large);
NextPage.BorderWidth = 1;
NextPage.HorizontalOptions = LayoutOptions.Center;
NextPage.VerticalOptions = LayoutOptions.CenterAndExpand;
content.Content = new StackLayout();
content.Content.VerticalOptions = LayoutOptions.CenterAndExpand;
content.Content.Children.Add(CompanyName);
エラーメッセージ – Nkosi
これは赤で強調表示されていますが、実際のエラーはコンソールに表示されません。 –