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


C# UIButton.SetStyleId方法代码示例

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


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

示例1: ViewDidLoad

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.Frame = UIScreen.MainScreen.Bounds;
            View.BackgroundColor = UIColor.White;
            View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;

            _button = UIButton.FromType(UIButtonType.RoundedRect);

            _button.Frame = new RectangleF(
                View.Frame.Width / 2 - ButtonWidth / 2,
                200,
                ButtonWidth,
                ButtonHeight);

            _button.SetTitle("Click me", UIControlState.Normal);

            _button.SetStyleId("button1");

            _button.TouchUpInside += (sender, e) => _button.SetTitle(String.Format("clicked {0} times", _numClicks++), UIControlState.Normal);

            _button.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleTopMargin |
                UIViewAutoresizing.FlexibleBottomMargin;

            View.AddSubview(_button);
        }
开发者ID:tluyben,项目名称:ProtoPad,代码行数:27,代码来源:MyViewController.cs

示例2: ViewDidLoad

        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            _button = UIButton.FromType (UIButtonType.Custom);
            _button.SetStyleId ("sample-button");
            _button.SetTitle ("Hello, world!", UIControlState.Normal);

            View.AddSubview (_button);
            View.SetStyleClass ("sample-background");
        }
开发者ID:jamilgeor,项目名称:Crayon,代码行数:11,代码来源:UIButtonExample.cs

示例3: ProductListViewController

		public ProductListViewController ()
		{
			Title = "Xamarin Store";

			// Hide the back button text when you leave this View Controller.
			NavigationItem.BackBarButtonItem = new UIBarButtonItem ("", UIBarButtonItemStyle.Plain, handler: null);

			btnRefresh = new UIButton ();//new RectangleF(10,400,200,30));
			//btnRefresh.SetTitle ("Refresh", UIControlState.Normal);
			btnRefresh.SetStyleId ("refresh");
			View.AddSubview (btnRefresh);

			GetData ();


			View.BackgroundColor = UIColor.White;

			btnRefresh.TouchUpInside += (object sender, EventArgs e) => {
				carousel.RemoveFromSuperview();
				GetData();
			};




		}
开发者ID:jonburn,项目名称:xamarin-store-app,代码行数:26,代码来源:ProductListViewController.cs


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