• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UIButton类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ViewDidLoad

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

            View.BackgroundColor = UIColor.White;

            var gameNameLabel = new UILabel(new RectangleF(10, 80, View.Frame.Width - 20, 20));
            gameNameLabel.Text = "Spartakiade Quiz";

            View.AddSubview(gameNameLabel);

            var playname = new UITextView(new RectangleF(10, 110, View.Frame.Width - 20, 20));
            playname.BackgroundColor = UIColor.Brown;

            View.AddSubview(playname);

            var btnStartGame = new UIButton(new RectangleF(10, 140, View.Frame.Width - 20, 20));
            btnStartGame.SetTitle("Start game", UIControlState.Normal);
            btnStartGame.BackgroundColor = UIColor.Blue;
            btnStartGame.TouchUpInside += delegate
            {
                NavigationController.PushViewController(new PlayGameController(playname.Text), true);
            };

            View.AddSubview(btnStartGame);
        }
开发者ID:CayasSoftware,项目名称:Spartakiade,代码行数:26,代码来源:GameStartController.cs


示例2: ViewDidLoad

        public override void ViewDidLoad()
        {
            View = new UIView(){ BackgroundColor = UIColor.White};
            base.ViewDidLoad();

            var label = new UILabel(new RectangleF(10, 10, 300, 40));
            Add(label);
            var textField = new UITextField(new RectangleF(10, 50, 300, 40));
            Add(textField);
            var button = new UIButton(UIButtonType.RoundedRect);
            button.SetTitle("Click Me", UIControlState.Normal);
            button.Frame = new RectangleF(10, 90, 300, 40);
            Add(button);
            var button2 = new UIButton(UIButtonType.RoundedRect);
            button2.SetTitle("Go Second", UIControlState.Normal);
            button2.Frame = new RectangleF(10, 130, 300, 40);
            Add(button2);

            var set = this.CreateBindingSet<FirstView, Core.ViewModels.FirstViewModel>();
            set.Bind(label).To(vm => vm.Hello);
            set.Bind(textField).To(vm => vm.Hello);
            set.Bind(button).To(vm => vm.MyCommand);
            set.Bind(button2).To(vm => vm.GoSecondCommand);
            set.Apply();
        }
开发者ID:janvdp,项目名称:NPlus1DaysOfMvvmCross,代码行数:25,代码来源:FirstView.cs


示例3: LoadView

    public void LoadView()
    {
        mBox = new UIBox(UIConstants.BoxRect, UIConstants.MainBackground);

        mBackgroundTextureLabel = new UILabel(UIConstants.RectLabelOne, UIConstants.CloudRecognition);

        string [] extendedTrackingStyle = {UIConstants.ExtendedTrackingStyleOff, UIConstants.ExtendedTrackingStyleOn};
        mExtendedTracking = new UICheckButton(UIConstants.RectOptionOne, false, extendedTrackingStyle);

        string[] aboutStyles = { UIConstants.AboutLableStyle, UIConstants.AboutLableStyle };
        mAboutLabel = new UICheckButton(UIConstants.RectLabelAbout, false, aboutStyles);

        string[] cameraFlashStyles = {UIConstants.CameraFlashStyleOff, UIConstants.CameraFlashStyleOn};
        mCameraFlashSettings = new UICheckButton(UIConstants.RectOptionThree, false, cameraFlashStyles);

        string[] autofocusStyles = {UIConstants.AutoFocusStyleOff, UIConstants.AutoFocusStyleOn};
        mAutoFocusSetting = new UICheckButton(UIConstants.RectOptionTwo, false, autofocusStyles);

        mCameraLabel = new UILabel(UIConstants.RectLabelTwo, UIConstants.CameraLabelStyle);

        string[,] cameraFacingStyles = new string[2,2] {{UIConstants.CameraFacingFrontStyleOff, UIConstants.CameraFacingFrontStyleOn},{ UIConstants.CameraFacingRearStyleOff, UIConstants.CameraFacingRearStyleOn}};
        UIRect[] cameraRect = { UIConstants.RectOptionFour, UIConstants.RectOptionFive };
        mCameraFacing = new UIRadioButton(cameraRect, 1, cameraFacingStyles);

        string[] closeButtonStyles = {UIConstants.closeButtonStyleOff, UIConstants.closeButtonStyleOn };
        mCloseButton = new UIButton(UIConstants.CloseButtonRect, closeButtonStyles);
    }
开发者ID:nileshlg2003,项目名称:NewCloud,代码行数:27,代码来源:CloudRecognitionUIView.cs


示例4: ViewDidLoad

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

            _loadDataButton = UIButton.FromType(UIButtonType.RoundedRect);
            _loadDataButton.SetTitle("Hent sanntidsdata", UIControlState.Normal);
            _loadDataButton.Frame = new RectangleF(10, 10, View.Bounds.Width - 20, 50);

            _result = new UITextView(new RectangleF(10, 70, View.Bounds.Width - 20, View.Bounds.Height - 80));
            _result.Font = UIFont.FromName("Arial", 14);
            _result.Editable = false;

            _activityIndicator = new UIActivityIndicatorView(new RectangleF(View.Bounds.Width / 2 - 20, View.Bounds.Height / 2 - 20, 40, 40));
            _activityIndicator.AutoresizingMask = UIViewAutoresizing.FlexibleBottomMargin | UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin;
            _activityIndicator.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.WhiteLarge;

            View.AddSubview(_activityIndicator);
            View.AddSubview(_loadDataButton);
            View.AddSubview(_result);

            View.BackgroundColor = UIColor.DarkGray;

            _loadDataButton.TouchUpInside += delegate(object sender, EventArgs e) {
                if(_location != null)
                {
                    _activityIndicator.StartAnimating();
                    _result.Text = "Jobber..." + Environment.NewLine + Environment.NewLine;
                    var coordinate = new GeographicCoordinate(_location.Latitude, _location.Longtitude);
                    ThreadPool.QueueUserWorkItem(o => _sanntid.GetNearbyStops(coordinate, BusStopsLoaded));
                }
            };

            _gpsService.LocationChanged = location => _location = location;
            _gpsService.Start();
        }
开发者ID:runegri,项目名称:MuPP,代码行数:35,代码来源:SanntidView.cs


示例5: 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,
                View.Frame.Height / 2 - buttonHeight / 2,
                buttonWidth,
                buttonHeight);

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

            button.TouchUpInside += (object sender, EventArgs e) =>
            {
                button.SetTitle(String.Format("clicked {0} times", numClicks++), UIControlState.Normal);
            };

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

            View.AddSubview(button);
        }
开发者ID:ChebMami38,项目名称:MvvmCross-Tutorials,代码行数:28,代码来源:MyViewController.cs


示例6: AddSiteUrl

		public void AddSiteUrl(RectangleF frame)
		{
			url = UIButton.FromType(UIButtonType.Custom);
			url.LineBreakMode = UILineBreakMode.TailTruncation;
			url.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
			url.TitleShadowOffset = new SizeF(0, 1);
			url.SetTitleColor(UIColor.FromRGB (0x32, 0x4f, 0x85), UIControlState.Normal);
			url.SetTitleColor(UIColor.Red, UIControlState.Highlighted);
			url.SetTitleShadowColor(UIColor.White, UIControlState.Normal);
			url.AddTarget(delegate { if (UrlTapped != null) UrlTapped (); }, UIControlEvent.TouchUpInside);
			
			// Autosize the bio URL to fit available space
			var size = _urlSize;
			var urlFont = UIFont.BoldSystemFontOfSize(size);
			var urlSize = new NSString(_bio.Url).StringSize(urlFont);
			var available = Util.IsPad() ? 400 : 185; // Util.IsRetina() ? 185 : 250;		
			while(urlSize.Width > available)
			{
				urlFont = UIFont.BoldSystemFontOfSize(size--);
				urlSize = new NSString(_bio.Url).StringSize(urlFont);
			}
			
			url.Font = urlFont;			
			url.Frame = new RectangleF ((float)_left, (float)70, (float)(frame.Width - _left), (float)size);
			url.SetTitle(_bio.Url, UIControlState.Normal);
			url.SetTitle(_bio.Url, UIControlState.Highlighted);			
			AddSubview(url);
		}
开发者ID:modulexcite,项目名称:artapp,代码行数:28,代码来源:BioView.cs


示例7: SessionCell

		const int buttonSpace = 45; //24;
		
		public SessionCell (UITableViewCellStyle style, NSString ident, Session showSession, string big, string small) : base (style, ident)
		{
			SelectionStyle = UITableViewCellSelectionStyle.Blue;
			
			titleLabel = new UILabel () {
				TextAlignment = UITextAlignment.Left,
				BackgroundColor = UIColor.FromWhiteAlpha (0f, 0f)
			};
			speakerLabel = new UILabel () {
				TextAlignment = UITextAlignment.Left,
				Font = smallFont,
				TextColor = UIColor.DarkGray,
				BackgroundColor = UIColor.FromWhiteAlpha (0f, 0f)
			};
			locationImageView = new UIImageView();
			locationImageView.Image = building;

			button = UIButton.FromType (UIButtonType.Custom);
			button.TouchDown += delegate {
				UpdateImage (ToggleFavorite ());
				if (AppDelegate.IsPad) {
					NSObject o = new NSObject();
					NSDictionary progInfo = NSDictionary.FromObjectAndKey(o, new NSString("FavUpdate"));

					NSNotificationCenter.DefaultCenter.PostNotificationName(
						"NotificationFavoriteUpdated", o, progInfo);
				}
			};
			UpdateCell (showSession, big, small);
			
			ContentView.Add (titleLabel);
			ContentView.Add (speakerLabel);
			ContentView.Add (button);
			ContentView.Add (locationImageView);
		}
开发者ID:topcbl,项目名称:mobile-samples,代码行数:37,代码来源:SessionCell.cs


示例8: TabControlItem

        public TabControlItem(CGRect frame, string title)
        {
            this.Frame = frame;
            var parentFrame = frame;
            var labelFont = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ? UIFont.BoldSystemFontOfSize(15) : UIFont.BoldSystemFontOfSize(10);

            this.labelTitle = new UILabel(new CGRect(0, 0, parentFrame.Width / 2, parentFrame.Height))
            {
                Text = title,
                TextAlignment = UITextAlignment.Center,
                AdjustsFontSizeToFitWidth = true,
                LineBreakMode = UILineBreakMode.TailTruncation,
                Lines = 2,
                Font = labelFont
            };

            this.button = new UIButton(new CGRect(0, 0, parentFrame.Width, parentFrame.Height));
            this.viewColor = new UIView(new CGRect(0, parentFrame.Height - 1, parentFrame.Width, 1));

            this.Add(this.labelTitle);
            this.Add(this.button);
            this.Add(this.viewColor);

            this.button.TouchUpInside += (s, e) =>
            {
                if (tabEnabled)
                {
                    SelectTab();
                }
            };
        }
开发者ID:Immons,项目名称:XamarinHelper,代码行数:31,代码来源:TabControlItem.cs


示例9: ViewDidLoad

        public override void ViewDidLoad()
        {
            View.BackgroundColor = UIColor.White;
            base.ViewDidLoad();

            var button = new UIButton(UIButtonType.RoundedRect);
            button.SetTitle("Search", UIControlState.Normal);
            Add(button);

            var text = new UITextField() { BorderStyle = UITextBorderStyle.RoundedRect };
            Add(text);

            View.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            var set = this.CreateBindingSet<SearchView, SearchViewModel>();
            set.Bind(button).To("Search");
            set.Bind(text).To(vm => vm.SearchText);
            set.Apply();

            var hPadding = 10;
            var vPadding = 10;
            var ButtonWidth = 100;

            View.AddConstraints(

                    button.AtTopOf(View).Plus(vPadding),
                    button.AtRightOf(View).Minus(hPadding),
                    button.Width().EqualTo(ButtonWidth),

                    text.AtLeftOf(View, hPadding),
                    text.ToLeftOf(button, hPadding),
                    text.WithSameTop(button)

                );
        }
开发者ID:Dexyon,项目名称:MvvmCross-Samples,代码行数:35,代码来源:SearchView.cs


示例10: ViewDidLoad

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

            button1 = UIButton.FromType(UIButtonType.RoundedRect);
            button1.Frame = new RectangleF(50, 20, 200, 40);
            button1.SetTitle("#myButton1 .allButtons", UIControlState.Normal);
            PXEngine.SetStyleId(button1, "myButton1");
            PXEngine.SetStyleClass(button1, "allButtons");

            button2 = UIButton.FromType(UIButtonType.RoundedRect);
            button2.Frame = new RectangleF(50, 70, 200, 40);
            button2.SetTitle("#myButton2 .allButtons", UIControlState.Normal);
            PXEngine.SetStyleId(button2, "myButton2");
            PXEngine.SetStyleClass(button2, "allButtons");

            button3 = UIButton.FromType(UIButtonType.RoundedRect);
            button3.Frame = new RectangleF(50, 120, 200, 40);
            button3.SetTitle("#myButton3 .allButtons", UIControlState.Normal);
            PXEngine.SetStyleId(button3, "myButton3");
            PXEngine.SetStyleClass(button1, "allButtons");

            PXEngine.SetStyleCSS(button3, "background-color: green; border-radius: 5;");

            this.View.AddSubview(button1);
            this.View.AddSubview(button2);
            this.View.AddSubview(button3);
        }
开发者ID:stefandevo,项目名称:MonoTouch-Pixate,代码行数:28,代码来源:AppDelegate.cs


示例11: ViewDidLoad

        public override void ViewDidLoad()
        {
            var mapView = new MKMapView();
            mapView.Delegate = new MyDelegate();
            View = mapView;

            base.ViewDidLoad();

            // ios7 layout
            if (RespondsToSelector(new Selector("edgesForExtendedLayout")))
                EdgesForExtendedLayout = UIRectEdge.None;

            var secondViewModel = (SecondViewModel)ViewModel;
            var hanAnnotation = new ZombieAnnotation(secondViewModel.Han);

            mapView.AddAnnotation(hanAnnotation);

            mapView.SetRegion(MKCoordinateRegion.FromDistance(
                new CLLocationCoordinate2D(secondViewModel.Han.Location.Lat, secondViewModel.Han.Location.Lng),
                20000,
                20000), true);

            var button = new UIButton(UIButtonType.RoundedRect);
            button.Frame = new RectangleF(10, 10, 300, 40);
            button.SetTitle("move", UIControlState.Normal);
            Add(button);

            var set = this.CreateBindingSet<SecondView, Core.ViewModels.SecondViewModel>();
            set.Bind(hanAnnotation).For(a => a.Location).To(vm => vm.Han.Location);
            set.Bind(button).For("Title").To(vm => vm.Han.Location);
            set.Apply();
        }
开发者ID:KiranKumarAlugonda,项目名称:NPlus1DaysOfMvvmCross,代码行数:32,代码来源:SecondView.cs


示例12: ConnectToBandClick

		async partial void ConnectToBandClick (UIButton sender)
		{
			if (client == null) {
				// get the client
				client = manager.AttachedClients.FirstOrDefault ();

				if (client == null) {
					Output ("Failed! No Bands attached.");
				} else {

					// attach event handlers
					client.ButtonPressed += (_, e) => {
						Output (string.Format ("Button {0} Pressed: {1}", e.TileButtonEvent.ElementId, e.TileButtonEvent.TileName));
					};
					client.TileOpened += (_, e) => {
						Output (string.Format ("Tile Opened: {0}", e.TileEvent.TileName));
					};
					client.TileClosed += (_, e) => {
						Output (string.Format ("Tile Closed: {0}", e.TileEvent.TileName));
					};

					try {
						Output ("Please wait. Connecting to Band...");
						await manager.ConnectTaskAsync (client);
					} catch (BandException ex) {
						Output ("Failed to connect to Band:");
						Output (ex.Message);
					}
				}
			} else {
				Output ("Please wait. Disconnecting from Band...");
				await manager.DisconnectTaskAsync (client);
				client = null;
			}
		}
开发者ID:JamesEarle,项目名称:Microsoft-Band-SDK-Bindings,代码行数:35,代码来源:MainViewController.cs


示例13: LayoutSubviews

        public override void LayoutSubviews()
        {
            base.LayoutSubviews();
            var cameraFound = false;

            if (UIImagePickerController.IsSourceTypeAvailable(UIImagePickerControllerSourceType.Camera))
            {
                cameraFound = true;

                var button = new UIButton(UIButtonType.Custom);
                button.Frame = new CoreGraphics.CGRect(Frame.Width - 44, 9, 28, 21);
                button.SetBackgroundImage(UIImage.FromFile("Barcode.png"), UIControlState.Normal);
                button.TouchUpInside += (sender, e) =>
                {
                    button.PulseToSize(0.7f, 0.3, false);
                    Clicked();
                };
                Subviews[0].AddSubview(button);
            }                      

            foreach(var view in Subviews[0].Subviews)
            {
                if (cameraFound && view.GetType() == typeof(UITextField))
                    view.Frame = new CoreGraphics.CGRect(6, 5, view.Frame.Width - 44, 30);

                var textfield = Subviews[0].Subviews[1] as UITextField;
                if (textfield != null)
                    textfield.Font = UIFont.FromName("Avenir-Book", 14);
            };

        }
开发者ID:vkoppaka,项目名称:BeerDrinkin,代码行数:31,代码来源:SearchBar.cs


示例14: SaveAndLaunchFile

        public Task SaveAndLaunchFile(Stream stream, string fileType)
        {
            if (OriginView == null) return Task.FromResult(true);

            var data = NSData.FromStream(stream);
            var width = 824;
            var height = 668;

            var popoverView = new UIView(new RectangleF(0, 0, width, height));
            popoverView.BackgroundColor = UIColor.White;
            var webView = new UIWebView();
            webView.Frame = new RectangleF(0, 45, width, height - 45);

            var b = new UIButton(UIButtonType.RoundedRect);
            b.SetTitle("Done", UIControlState.Normal);
            b.Frame = new RectangleF(10,10, 60, 25);
            b.TouchUpInside += (o, e) => _popoverController.Dismiss(true);

            popoverView.AddSubview(b);
            popoverView.AddSubview(webView);

            var bundlePath = NSBundle.MainBundle.BundlePath;
            System.Diagnostics.Debug.WriteLine(bundlePath);
            webView.LoadData(data, "application/pdf", "utf-8", NSUrl.FromString("http://google.com"));

            var popoverContent = new UIViewController();
            popoverContent.View = popoverView;

            _popoverController = new UIPopoverController(popoverContent);
            _popoverController.PopoverContentSize = new SizeF(width, height);
            _popoverController.PresentFromRect(new RectangleF(OriginView.Frame.Width/2, 50, 1, 1), OriginView, UIPopoverArrowDirection.Any, true);
            _popoverController.DidDismiss += (o, e) => _popoverController = null;

            return Task.FromResult(true);
        }
开发者ID:reactiveui-forks,项目名称:VirtualSales,代码行数:35,代码来源:PlatformServices.cs


示例15: OnElementChanged

		protected async override void OnElementChanged (ElementChangedEventArgs<Button> e)
		{
			base.OnElementChanged (e);

			if (byPassButton == null) {
				byPassButton = new UIButton (UIButtonType.Custom);
				byPassButton.Frame = this.Frame;
				SetNativeControl (byPassButton);
				base.Control.TouchUpInside += byPassButton_TouchUpInside;

				SetField (this, "buttonTextColorDefaultNormal", base.Control.TitleColor (UIControlState.Normal));
				SetField (this, "buttonTextColorDefaultHighlighted", base.Control.TitleColor (UIControlState.Highlighted));
				SetField (this, "buttonTextColorDefaultDisabled", base.Control.TitleColor (UIControlState.Disabled));

				InvokeMethod (this, "UpdateText", null);
				InvokeMethod (this, "UpdateFont", null);
				InvokeMethod (this, "UpdateBorder", null);
				InvokeMethod (this, "UpdateImage", null);
				InvokeMethod (this, "UpdateTextColor", null);
			}

			if (e.NewElement != null) {
				Control.ShowsTouchWhenHighlighted = false;
				Control.AdjustsImageWhenHighlighted = false;
				await SetNormalImageResource ();
				await SetDisableImageResource ();
				await SetPressImageResource ();
			}
		}
开发者ID:AlejandroRuiz,项目名称:FloatingTextEntry,代码行数:29,代码来源:StatesButtonRenderer.cs


示例16: OnElementChanged

		protected override void OnElementChanged (ElementChangedEventArgs<View> e)
		{
			base.OnElementChanged (e);

			//Get the video
			//bubble up to the AVPlayerLayer
			var url = new NSUrl ("http://www.androidbegin.com/tutorial/AndroidCommercial.3gp");
			_asset = AVAsset.FromUrl (url);

			_playerItem = new AVPlayerItem (_asset);

			_player = new AVPlayer (_playerItem);

			_playerLayer = AVPlayerLayer.FromPlayer (_player);

			//Create the play button
			playButton = new UIButton ();
			playButton.SetTitle ("Play Video", UIControlState.Normal);
			playButton.BackgroundColor = UIColor.Gray;

			//Set the trigger on the play button to play the video
			playButton.TouchUpInside += (object sender, EventArgs arg) => {
				_player.Play();
			};
		}
开发者ID:ChandrakanthBCK,项目名称:customer-success-samples,代码行数:25,代码来源:VideoPlayer_CustomRenderer.cs


示例17: CheckButton_TouchUpInside

 partial void CheckButton_TouchUpInside(UIButton sender)
 {
     string title = MyClass.iOSInfo();
     int ii = MyClass.iOSInt();
     CheckButton.SetTitle(title, UIControlState.Normal);
     CheckButton.Enabled = true;
 }
开发者ID:disenone,项目名称:CrossStudy,代码行数:7,代码来源:ViewController.cs


示例18: ViewDidLoad

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            if (RespondsToSelector(new Selector("edgesForExtendedLayout")))
                EdgesForExtendedLayout = UIRectEdge.None;

            var source = new MvxStandardTableViewSource(TableView, UITableViewCellStyle.Subtitle, new NSString("sub"), "TitleText PriceText;ImageUrl ImageUri;DetailText DetailsText", UITableViewCellAccessory.DisclosureIndicator);
            TableView.Source = source;

            var set = this.CreateBindingSet<SearchResultsView, SearchResultsViewModel>();
            set.Bind(source).To(vm => vm.Properties);
            set.Bind(source).For(s => s.SelectionChangedCommand).To(vm => vm.PropertiesSelectedCommand);
            set.Bind(this).For(s => s.Title).To(vm => vm.Title);
            var myFooter = new UIView(new RectangleF(0, 0, 320, 40));

            UIButton loadMoreButton = new UIButton(new RectangleF(0, 0, 320, 40));
            loadMoreButton.SetTitle("Load More", UIControlState.Normal);
            loadMoreButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            set.Bind(loadMoreButton).To(vm => vm.LoadMoreCommand);
            set.Bind(loadMoreButton).For("Title").To(vm => vm.Title);

            myFooter.Add(loadMoreButton);

            TableView.TableFooterView = myFooter;

            set.Apply();

            TableView.ReloadData();
            ViewModel.WeakSubscribe(PropertyChanged);

            NavigationItem.BackBarButtonItem = new UIBarButtonItem("Results",
                         UIBarButtonItemStyle.Bordered, BackButtonEventHandler);
        }
开发者ID:rossdargan,项目名称:PropertyCross-Mvvmcross,代码行数:33,代码来源:SearchResultsView.cs


示例19: StartAccelerometerClick

		partial void StartAccelerometerClick (UIButton sender)
		{
			if (client != null && client.IsDeviceConnected) {
				// create the sensor once
				if (accelerometer == null) {
					accelerometer = client.SensorManager.CreateAccelerometerSensor ();
					accelerometer.ReadingChanged += (_, e) => {
						var data = e.SensorReading;
						AccelerometerDataText.Text = string.Format ("Accel Data: X={0:+0.00} Y={0:+0.00} Z={0:+0.00}", data.X, data.Y, data.Z);
					};
				}
				if (sensorStarted) {
					Output ("Stopping Accelerometer updates...");
					try {
						accelerometer.StopReadings ();
						sensorStarted = false;
					} catch (BandException ex) {
						Output ("Error: " + ex.Message);
					}
				} else {
					Output ("Starting Accelerometer updates...");
					try {
						accelerometer.StartReadings ();
						sensorStarted = true;
					} catch (BandException ex) {
						Output ("Error: " + ex.Message);
					}
				}
			} else {
				Output ("Band is not connected. Please wait....");
			}
		}
开发者ID:modulexcite,项目名称:CRMBandNotifications,代码行数:32,代码来源:MainViewController.cs


示例20: CreateCell

        protected override StandardContentCell CreateCell(UITableView tableView)
        {
            var cell = new StandardContentCell(UITableViewCellStyle.Default, Type);
            cell.SelectionStyle = UITableViewCellSelectionStyle.None;

            button = UIButton.FromType (UIButtonType.Custom);

            button.SetTitle (Text, UIControlState.Normal);
            button.Font = UIFont.BoldSystemFontOfSize (16);
            button.BackgroundColor = BackgroundColor;
            button.TitleEdgeInsets = new UIEdgeInsets(0, 6, 0, 6);
            button.Layer.CornerRadius = 7.0f;
            button.SetTitleColor(TextColor, UIControlState.Normal);
            button.SizeToFit ();
            button.TouchUpInside += delegate {
                RowSelectedImpl (tableView);
            };

            if (Disable) {
                button.UserInteractionEnabled = false;
                button.Enabled = false;
                button.TitleLabel.Enabled = false;
            }

            float left = (tableView.Frame.Width - button.Frame.Width ) / 2 - 12;
            button.Frame = new RectangleF(left, 4, button.Frame.Width + 12, 36);

            cell.ContentView.Add (button);

            return cell;
        }
开发者ID:jivkopetiov,项目名称:StackApp,代码行数:31,代码来源:ContentRows.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UICamera类代码示例发布时间:2022-05-24
下一篇:
C# UIBarButtonItem类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap