本文整理汇总了C#中UISegmentedControl.TitleAt方法的典型用法代码示例。如果您正苦于以下问题:C# UISegmentedControl.TitleAt方法的具体用法?C# UISegmentedControl.TitleAt怎么用?C# UISegmentedControl.TitleAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UISegmentedControl
的用法示例。
在下文中一共展示了UISegmentedControl.TitleAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateSegmentedControl
void CreateSegmentedControl ()
{
// _segmentedControl = new UISegmentedControl (new object[] { "one", "two", "three", "four" });
// _segmentedControl.ControlStyle = UISegmentedControlStyle.Bezeled;
// _segmentedControl.TintColor = UIColor.Black;
// _segmentedControl.SetImage (UIImage.FromFile ("Star.png"), 0);
// _segmentedControl.SelectedSegment = 0;
// _segmentedControl.Frame = new RectangleF (10, 10, View.Frame.Width - 20, 50);
_testLabel = new UILabel { Frame = new RectangleF (10, 200, 100, 50) };
_segmentedControl = new UISegmentedControl (new object[] { UIImage.FromFile ("Star.png"), "two", "three", "four" });
_segmentedControl.ControlStyle = UISegmentedControlStyle.Bezeled;
_segmentedControl.TintColor = UIColor.Black;
_segmentedControl.Frame = new RectangleF (10, 10, View.Frame.Width - 20, 50);
_segmentedControl.ValueChanged += (o, e) =>
{
_text = _segmentedControl.TitleAt (_segmentedControl.SelectedSegment) ?? "title not set";
_testLabel.Text = _text;
};
_segmentedControl.SelectedSegment = 0;
_segmentedControl.AddSubview (_testLabel);
View.AddSubview (_segmentedControl);
}