0

Android で使用する画面に GUI 要素を追加する場合

this.add 

これは Windows phone 7 でどのように行うことができますか?

4

1 に答える 1

2

私はAndroidについてあまり知りませんが、画面にUI要素を追加したい場合はWindows Phoneアプリで:

最初に、すべてのプロパティを設定して必要な要素を作成します

Button button = new Button();
button.Content = "Click here";
button.Width = 100;
button.Height = 50;

そして、それを XAML ページに追加します。

Grid.SetRow(button, 2); //here 2 is the row number in which you want to place your element
this.ContentPanel.Children.Add(button); //this adds the button to the "ContentPanel" grid

StackPanel への追加は、Grid と比較するとはるかに簡単です。

this.stackPanel.Children.Add(button); //where stackPanel is the name of the existing StackPanel

GRIDおよびSTACKPANELに要素を追加するには、次のリンクを参照してください。

于 2012-08-23T07:42:42.310 に答える