本文整理汇总了C#中UIImageView.Add方法的典型用法代码示例。如果您正苦于以下问题:C# UIImageView.Add方法的具体用法?C# UIImageView.Add怎么用?C# UIImageView.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIImageView
的用法示例。
在下文中一共展示了UIImageView.Add方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadView
public override void LoadView ()
{
View = new UIImageView () {
UserInteractionEnabled = true,
} .Apply (Style.Welcome.Background);
View.Add (logoImageView = new UIImageView ().Apply (Style.Welcome.Logo));
View.Add (sloganLabel = new UILabel () {
Text = "WelcomeSlogan".Tr (),
} .Apply (Style.Welcome.Slogan));
View.Add (createButton = new UIButton ().Apply (Style.Welcome.CreateAccount));
View.Add (passwordButton = new UIButton ().Apply (Style.Welcome.PasswordLogin));
View.Add (googleButton = new UIButton ().Apply (Style.Welcome.GoogleLogin));
createButton.SetTitle ("WelcomeCreate".Tr (), UIControlState.Normal);
passwordButton.SetTitle ("WelcomePassword".Tr (), UIControlState.Normal);
googleButton.SetTitle ("WelcomeGoogle".Tr (), UIControlState.Normal);
createButton.TouchUpInside += OnCreateButtonTouchUpInside;
passwordButton.TouchUpInside += OnPasswordButtonTouchUpInside;
googleButton.TouchUpInside += OnGoogleButtonTouchUpInside;
View.AddConstraints (
logoImageView.AtTopOf (View, 70f),
logoImageView.WithSameCenterX (View),
sloganLabel.Below (logoImageView, 18f),
sloganLabel.AtLeftOf (View, 25f),
sloganLabel.AtRightOf (View, 25f),
googleButton.AtBottomOf (View, 20f),
googleButton.AtLeftOf (View),
googleButton.AtRightOf (View),
googleButton.Height ().EqualTo (60f),
passwordButton.Above (googleButton, 25f),
passwordButton.AtLeftOf (View),
passwordButton.AtRightOf (View),
passwordButton.Height ().EqualTo (60f),
createButton.Above (passwordButton, 5f),
createButton.AtLeftOf (View),
createButton.AtRightOf (View),
createButton.Height ().EqualTo (60f)
);
View.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints ();
}
示例2: InitWheel
private void InitWheel()
{
var sectionNumber = _settings.Slices.Count;
_container = new UIView(Frame);
_slices = new List<WheelSlice>(sectionNumber);
var angleSize = (float)(2 * Math.PI / sectionNumber);
for (int i = 0; i < sectionNumber; i++)
{
var imageView = new UIImageView(_settings.SegmentImage);
imageView.Layer.AnchorPoint = new PointF(1.0f, 0.5f);
var slicePosX = (float)(_container.Bounds.Size.Width / (2.0 - _container.Frame.X));
var slicePosY = (float)(_container.Bounds.Size.Height / 2.0 - _container.Frame.Y);
imageView.Layer.Position = new PointF(slicePosX, slicePosY);
imageView.Transform = CGAffineTransform.MakeRotation(angleSize * i);
imageView.Alpha = _minAlphaValue;
imageView.Tag = i;
if (i == 0)
{
imageView.Alpha = _maxAlphaValue;
}
var sliceImageView = new UIImageView(new RectangleF(12, 15, 40, 40));
var sliceImage = _settings.Slices[i].Image;
sliceImageView.Image = sliceImage;
imageView.Add(sliceImageView);
_container.Add(imageView);
}
_container.UserInteractionEnabled = false;
Add(_container);
var backgroundView = new UIImageView(Frame) { Image = _settings.BackgroundImage };
Add(backgroundView);
var mask = new UIImageView(new RectangleF(0, 0, 58, 58))
{
Image = _settings.CenterButtonImage,
Center = Center
};
mask.Center = new PointF(mask.Center.X, mask.Center.Y + 3);
Add(mask);
if (sectionNumber % 2 == 0)
{
BuildSlicesEvenly();
}
else
{
BuildSlicesUnEvenly();
}
//SliceDidChanged(this, new SliceDidChangedEventArgs { Value = _settings.Slices[0].Value });
}
示例3: GetViewForHeader
public override UIView GetViewForHeader (UITableView tableView, nint section)
{
var sectionTitleLabel = new UILabel (new CGRect (10, 3, 300, 22));
sectionTitleLabel.Text = "Resistence Workouts";
sectionTitleLabel.BackgroundColor = UIColor.Clear;
sectionTitleLabel.TextColor = UIColor.FromRGBA (0.43f, 0.43f, 0.43f, 1);
sectionTitleLabel.Font = UIFont.FromName ("HelveticaNeue", 15);
var backgroundView = new UIImageView (FitpulseTheme.SharedTheme.TableSectionHeaderBackground);
backgroundView.Add (sectionTitleLabel);
return backgroundView;
}
示例4: GetViewForHeader
public override UIView GetViewForHeader(UITableView tableView, int section)
{
var title = tweets.ElementAt(section).Key;
var bg = new UIView(new RectangleF(0,0,320,40));
bg.BackgroundColor = UIColor.Clear;
//var bg2 = new UIView(new Rectangle(0,0,320,30));
//bg2.BackgroundColor = UIColor.FromRGBA(108/255f,195/255f,22/255f,0.6f);
var bg2 = new UIImageView(new Rectangle(0,0,320,30));
bg2.Image = UIImage.FromBundle("tweet_Header");
var lbl_Header = new UILabel(new RectangleF(10, 0, 300, 30));
lbl_Header.Text = title;
lbl_Header.TextAlignment = UITextAlignment.Left;
lbl_Header.BackgroundColor = UIColor.Clear;
lbl_Header.TextColor = UIColor.White;
lbl_Header.Font = App.FontForTweetHeader;
bg2.Add(lbl_Header);
bg.Add(bg2);
return bg;
}
示例5: GetTimePicker
private static UIView GetTimePicker(float viewWidth, float viewHeight)
{
year = DateTime.Now.Year;
month = DateTime.Now.Month;
day = DateTime.Now.Day;
UIView view = new UIView(new RectangleF((viewWidth - TIMEWIDTH) / 2, (viewHeight - BUTTONHEIGHT - TIMEHEIGHT) / 2, TIMEWIDTH, TIMEHEIGHT));
view.BackgroundColor = UIColor.Clear;
UIImageView imageView = new UIImageView(new RectangleF(0, 0, TIMEWIDTH, TIMEHEIGHT));
imageView.Image = TIMEBACKIMAGE;
UIButton yearIncrease = new UIButton(new RectangleF(0, 0, TIMEITEMFRISTWIDTH, TIMEBUTTONHEIGHT));
yearIncrease.BackgroundColor = UIColor.Clear;
UIButton yeatText = new UIButton(new RectangleF(0, TIMEBUTTONHEIGHT, TIMEITEMFRISTWIDTH, TIMETEXTHEIGHT));
yeatText.BackgroundColor = UIColor.Clear;
yeatText.SetTitle(year.ToString(), UIControlState.Normal);
yeatText.Font = UIFont.FromName(FONTFAMILY, 20);
UIButton yearReduced = new UIButton(new RectangleF(0, TIMEBUTTONHEIGHT + TIMETEXTHEIGHT, TIMEITEMFRISTWIDTH, TIMEBUTTONHEIGHT));
yearReduced.BackgroundColor = UIColor.Clear;
UIButton monthIncrease = new UIButton(new RectangleF(TIMEITEMFRISTWIDTH, 0, TIMETIEMOTHERWIDTH, TIMEBUTTONHEIGHT));
monthIncrease.BackgroundColor = UIColor.Clear;
UIButton monthText = new UIButton(new RectangleF(TIMEITEMFRISTWIDTH, TIMEBUTTONHEIGHT, TIMETIEMOTHERWIDTH, TIMETEXTHEIGHT));
monthText.BackgroundColor = UIColor.Clear;
monthText.SetTitle(month.ToString(), UIControlState.Normal);
monthText.Font = UIFont.FromName(FONTFAMILY, 20);
UIButton monthReduced = new UIButton(new RectangleF(TIMEITEMFRISTWIDTH, TIMEBUTTONHEIGHT + TIMETEXTHEIGHT, TIMETIEMOTHERWIDTH, TIMEBUTTONHEIGHT));
monthReduced.BackgroundColor = UIColor.Clear;
UIButton dayIncrease = new UIButton(new RectangleF(TIMEITEMFRISTWIDTH + TIMETIEMOTHERWIDTH, 0, TIMETIEMOTHERWIDTH, TIMEBUTTONHEIGHT));
dayIncrease.BackgroundColor = UIColor.Clear;
UIButton dayText = new UIButton(new RectangleF(TIMEITEMFRISTWIDTH + TIMETIEMOTHERWIDTH, TIMEBUTTONHEIGHT, TIMETIEMOTHERWIDTH, TIMETEXTHEIGHT));
dayText.BackgroundColor = UIColor.Clear;
dayText.SetTitle(day.ToString(), UIControlState.Normal);
dayText.Font = UIFont.FromName(FONTFAMILY, 20);
UIButton dayReduced = new UIButton(new RectangleF(TIMEITEMFRISTWIDTH + TIMETIEMOTHERWIDTH, TIMEBUTTONHEIGHT + TIMETEXTHEIGHT, TIMETIEMOTHERWIDTH, TIMEBUTTONHEIGHT));
dayReduced.BackgroundColor = UIColor.Clear;
imageView.Add(yearIncrease);
imageView.Add(yearReduced);
imageView.Add(yeatText);
imageView.Add(monthIncrease);
imageView.Add(monthReduced);
imageView.Add(monthText);
imageView.Add(dayIncrease);
imageView.Add(dayReduced);
imageView.Add(dayText);
view.Add(imageView);
return view;
}