private void prepareSiriButton() { var button = new INUIAddVoiceShortcutButton(INUIAddVoiceShortcutButtonStyle.Black); button.TranslatesAutoresizingMaskIntoConstraints = false; var descriptionLabel = new UILabel { Text = Resources.SiriCustomTimeEntryInstruction, Font = UIFont.SystemFontOfSize(12), TextColor = Colors.Siri.InvocationPhrase.ToNativeColor() }; descriptionLabel.TranslatesAutoresizingMaskIntoConstraints = false; AddToSiriWrapperView.AddSubview(button); AddToSiriWrapperView.AddSubview(descriptionLabel); NSLayoutConstraint.ActivateConstraints(new[] { descriptionLabel.CenterXAnchor.ConstraintEqualTo(AddToSiriWrapperView.CenterXAnchor), descriptionLabel.TopAnchor.ConstraintEqualTo(AddToSiriWrapperView.TopAnchor, 16), button.CenterXAnchor.ConstraintEqualTo(AddToSiriWrapperView.CenterXAnchor), button.TopAnchor.ConstraintEqualTo(descriptionLabel.BottomAnchor, 16), button.WidthAnchor.ConstraintEqualTo(150), button.HeightAnchor.ConstraintEqualTo(50), }); button.TouchUpInside += siriButtonHandler; }
public void INUIAddVoiceShortcutButtonTest() { TestRuntime.AssertXcodeVersion(10, 0); TestRuntime.AssertDevice(); var shortcutButton = new INUIAddVoiceShortcutButton(INUIAddVoiceShortcutButtonStyle.Black); shortcutButton.SpringLoaded = true; Assert.IsTrue(shortcutButton.SpringLoaded); }