当前位置: 首页>>代码示例>>C#>>正文


C# Button.SetY方法代码示例

本文整理汇总了C#中Button.SetY方法的典型用法代码示例。如果您正苦于以下问题:C# Button.SetY方法的具体用法?C# Button.SetY怎么用?C# Button.SetY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Button的用法示例。


在下文中一共展示了Button.SetY方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            var mLayout = new FrameLayout(this);

            surface = UrhoSurface.CreateSurface(this, typeof(MySample));
            //surface.Background.SetAlpha(10);

            TextView txtView = new TextView(this);
            txtView.SetBackgroundColor(Color.Violet);
            txtView.SetWidth(10);
            txtView.SetHeight(10);

            txtView.Text = "HAHAH";
            //txtView.Text = surface.Background.ToString();
            Button btn = new Button(this);
            btn.SetBackgroundColor(Color.Transparent);
            btn.Text = "Button";
            btn.SetHeight(100);
            btn.SetWidth(100);
            btn.SetX(30);
            btn.SetY(30);
            btn.TextAlignment = TextAlignment.Center;
            mLayout.AddView(txtView);
            mLayout.AddView(btn);
            mLayout.AddView(surface);
            SetContentView(mLayout);
        }
开发者ID:ZENG-Yuhao,项目名称:Xamarin-CrossPlatform,代码行数:28,代码来源:GameActivity.cs

示例2: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.allstatia);
            myListView = FindViewById<ListView> (Resource.Id.listView1);
            textbox = FindViewById<EditText> (Resource.Id.editText1);
            textbox.Visibility = ViewStates.Invisible;
            textbox.SetY (-210);
            Search = FindViewById<Button> (Resource.Id.button1);
            Search.SetY (-160);
            Search.Click += Search_Click;
            myListView.SetY (0);
            var metrics = Resources.DisplayMetrics;
            myListView.SetMinimumHeight (metrics.HeightPixels);
            string IdStatya = Intent.GetStringExtra ("IdJournal");
            NameStatya = new List<string> ();
            Statya = new List<statya> ();
            Statya = PrasingJournalJSON (IdStatya);
            Themes = new List<string> ();
            SectionName = new List<string> ();
            foreach (statya ST in Statya) {
                if (Themes == null) {
                    Themes.Add (ST.Section);
                } else {
                    for (int i = 0; i < Themes.Count; i++) {
                        if (ST.Section == Themes [i]) {
                            sravn = true;
                        }
                    }
                    if (sravn == false) {
                        Themes.Add (ST.Section);
                    } else {
                        sravn = false;
                    }
                }
            }
            string Section;
            Section = null;
            for (int i = 0; i < Statya.Count; i++) {
                if (Section == Statya [i].Section) {
                    NameStatya.Add (Statya [i].ArticleTitle);
                } else {
                    NameStatya.Add (Statya [i].Section);
                    NameStatya.Add (Statya [i].ArticleTitle);
                    Section = Statya [i].Section;
                    SectionName.Add (Statya [i].Section);
                }

            }
            ArrayAdapter<String> adapter = new ArrayAdapter<string> (this, Resource.Layout.List_item, NameStatya);
            myListView.Adapter = adapter;
            myListView.ItemClick += MyListView_ItemClick;
        }
开发者ID:baitun,项目名称:BGUEP-Journal,代码行数:53,代码来源:statia.cs


注:本文中的Button.SetY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。