本文整理汇总了C#中UIView.AddSubviews方法的典型用法代码示例。如果您正苦于以下问题:C# UIView.AddSubviews方法的具体用法?C# UIView.AddSubviews怎么用?C# UIView.AddSubviews使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIView
的用法示例。
在下文中一共展示了UIView.AddSubviews方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VideoCell
public VideoCell(NSString cellId)
: base(UITableViewCellStyle.Default, cellId)
{
SelectionStyle = UITableViewCellSelectionStyle.None;
heading = new UILabel ();
heading.TextColor = UIColor.White;
heading.Font = UIFont.FromName ("Helvetica-Bold", 14f);
heading.BackgroundColor = UIColor.Clear;
heading.Lines = 2;
category = new UILabel ();
category.TextColor = UIColor.Red;
category.Font = UIFont.FromName ("Helvetica", 12f);
category.BackgroundColor = UIColor.Clear;
image = new UIImageView ();
image.ContentMode = UIViewContentMode.ScaleAspectFill;
image.ClipsToBounds = true;
play = new UIImageView ();
headingView = new UIView ();
headingView.BackgroundColor = UIColor.FromRGBA (0, 0, 0, 120);
headingView.AddSubviews (new UIView[] { play, heading, category });
ContentView.Add (image);
ContentView.Add (headingView);
}
示例2: LoadView
public override void LoadView()
{
base.LoadView();
this.View.Layer.BackgroundColor = ColorScheme.Clouds.CGColor;
SearchButton = new UIButton();
holderView = new UIView(this.View.Frame);
SearchTableView = new UITableView(new CGRect(), UITableViewStyle.Grouped);
scrollView = new UIScrollView(this.View.Frame);
SearchCityLabel = new UILabel { TextAlignment = UITextAlignment.Center };
SearchCityLabel.AttributedText = new NSAttributedString(String.Format("Search {0} for:", Location.SiteName), Constants.LabelAttributes);
ads = new ADBannerView();
SearchButton.Layer.BackgroundColor = ColorScheme.MidnightBlue.CGColor;
SearchButton.Layer.CornerRadius = 10;
SearchButton.ClipsToBounds = true;
SearchButton.SetAttributedTitle(new NSAttributedString("Search", Constants.ButtonAttributes), UIControlState.Normal);
SearchTableView.Layer.BackgroundColor = ColorScheme.Clouds.CGColor;
holderView.AddSubviews(new UIView[] { SearchButton, SearchCityLabel, SearchTableView, ads });
scrollView.AddSubview(holderView);
this.View.AddSubview(scrollView);
AddLayoutConstraints();
saveButton = new UIBarButtonItem(
UIImage.FromFile("save.png"),
UIBarButtonItemStyle.Plain,
SaveButtonClicked);
NavigationItem.RightBarButtonItem = saveButton;
}
示例3: UICustomProgressView
public UICustomProgressView()
{
currentProgressLabel = new UILabel();
currentProgressLabel.Text = "10000000";
ofProgressLabel = new UILabel();
ofProgressLabel.Text = "of";
totalProgressLabel = new UILabel();
totalProgressLabel.Text = "10000000";
progressNoContainer = new UIView();
progressNoContainer.BackgroundColor = UIColor.Yellow;
progressNoContainer.Layer.BorderColor = UIColor.Red.CGColor;
progressNoContainer.Layer.BorderWidth = 2f;
progressNoContainer.AddSubviews(new UIView[] { currentProgressLabel, ofProgressLabel, totalProgressLabel });
progressNoContainer.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();
progressNoContainer.AddConstraints(new[]
{
currentProgressLabel.AtTopOf(progressNoContainer),
currentProgressLabel.WithSameCenterX(progressNoContainer).Minus(25),
currentProgressLabel.Height().EqualTo(30),
ofProgressLabel.WithSameTop(currentProgressLabel),
ofProgressLabel.ToRightOf(currentProgressLabel).Plus(5),
ofProgressLabel.WithSameHeight(currentProgressLabel),
totalProgressLabel.WithSameBottom(ofProgressLabel),
totalProgressLabel.ToRightOf(ofProgressLabel).Plus(5),
totalProgressLabel.WithSameHeight(ofProgressLabel)
});
AddSubviews(new[] { progressNoContainer });
this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();
this.AddConstraints(new[]
{
progressNoContainer.WithSameCenterY(this),
progressNoContainer.WithSameRight(this).Minus(10),
progressNoContainer.Width().EqualTo(100),
progressNoContainer.Height().EqualTo(30)
});
}
示例4: UIViewFactory
//CUSTOM CELL
public UIView UIViewFactory()
{
UIView uiview_xibless = new UIView();
uiview_xibless.Frame = new RectangleF(0,0,768,44);
UIButton btnDelete;
UILabel lblName;
UILabel lblDate;
btnDelete = UIButton.FromType(UIButtonType.Custom);
btnDelete.Frame = new RectangleF(7,8,103,27);
//UIControlState = Normal -> default system state for iOS element
//UIControlState = Highlighted -> Highlighted state of a control.
// A control enters this state when a touch enters and exits
// during tracking and when there is a touch up event.
btnDelete.SetTitleColor(UIColor.Blue,UIControlState.Normal);
btnDelete.SetTitleColor(UIColor.Red,UIControlState.Highlighted);
btnDelete.SetTitle("Delete", UIControlState.Normal);
btnDelete.TouchUpInside += (object sender, EventArgs e) =>
{
};
lblName = new UILabel(new RectangleF(140,11,489,21));
lblDate = new UILabel(new RectangleF(583,11,165,21));
lblName.Text = "Name";
lblDate.Text = DateTime.Now.ToString();
UIView [] views =
{
btnDelete,
lblName,
lblDate
};
uiview_xibless.AddSubviews(views);
return uiview_xibless;
}
示例5: LoadView
public override void LoadView()
{
base.LoadView();
this.View.Layer.BackgroundColor = ColorScheme.Clouds.CGColor;
closeIcon = new UIImageView(UIImage.FromBundle("Delete-50.png"));
CurrentImage = new UIImageView();
scrollview = new UIScrollView(this.View.Frame);
holderView = new UIView(this.View.Frame);
holderView.AddSubviews(new UIView[]{closeIcon, CurrentImage});
scrollview.AddSubview(holderView);
this.View.AddSubview(scrollview);
AddLayoutConstraints();
this.View.BackgroundColor = ColorScheme.Clouds;
scrollview.BackgroundColor = ColorScheme.Clouds;
scrollview.BackgroundColor.ColorWithAlpha(0.7f);
CurrentImage.ContentMode = UIViewContentMode.ScaleAspectFit;
closeIcon.UserInteractionEnabled = true;
}
示例6: InitSubviews
public void InitSubviews ()
{
var image = UIImage.FromFile ("profile-stats-bg.png");
profileDetailsView = new UIView ();
profileDetailsView.BackgroundColor = UIColor.FromPatternImage (image);
profileDetailsView.Frame = new CGRect (profileDetailsView.Frame.Location, image.Size);
workoutButton = Buttons.ProfileButton ("Workouts", "stats-workout.png");
cardioButton = Buttons.ProfileButton ("Cardio", "stats-cardio.png");
journalButton = Buttons.ProfileButton ("Journal", "stats-journal.png");
cardioButton.ImageEdgeInsets = new UIEdgeInsets (0, 19, 3, 0);
cardioButton.TitleEdgeInsets = new UIEdgeInsets (0, 34, 3, 0);
journalButton.ImageEdgeInsets = new UIEdgeInsets (0, 9, 3, 0);
journalButton.TitleEdgeInsets = new UIEdgeInsets (0, 22, 3, 0);
profileIcon = new UIImageView (UIImage.FromFile ("picture.png"));
profileIcon.Center = new PointF (58, 55);
profileDetailsView.AddSubviews (profileIcon, workoutButton, cardioButton, journalButton);
InitLabels ();
ProfileTableViewController = new ProfileController ();
var tableFooterImageView = new UIImageView (FitpulseTheme.SharedTheme.TableFooterBackground);
ProfileTableViewController.TableView.TableFooterView = tableFooterImageView;
ProfileTableViewController.TableView.ReloadData ();
Add (ProfileTableViewController.View);
Add (profileDetailsView);
}
示例7: TwoDotLoading
public static UIView TwoDotLoading(CGRect frame)
{
var dotDiameter = 2f;
var loadingView = new UIView (new CGRect ((frame.Width - _padding) / 2f, _padding * 2, _padding, _padding));
UIView firstDot = new UIView (new CGRect (
(loadingView.Frame.Width - dotDiameter) / 2f + 7.5f,
(loadingView.Frame.Height - dotDiameter) / 2f,
dotDiameter,
dotDiameter
));
firstDot.Layer.CornerRadius = dotDiameter / 2f;
firstDot.BackgroundColor = UIColor.Gray;
UIView secondDot = new UIView (new CGRect (
(loadingView.Frame.Width - dotDiameter) / 2f - 7.5f,
(loadingView.Frame.Height - dotDiameter) / 2f,
dotDiameter,
dotDiameter
));
secondDot.Layer.CornerRadius = dotDiameter / 2f;
secondDot.BackgroundColor = UIColor.Gray;
loadingView.AddSubviews (firstDot, secondDot);
var firstDotCenter = firstDot.Center;
var secondDotCenter = secondDot.Center;
UIView.Animate (0.8, 0.4, UIViewAnimationOptions.CurveEaseInOut | UIViewAnimationOptions.Autoreverse | UIViewAnimationOptions.Repeat,
() => {
firstDot.Center =
new CGPoint (
secondDotCenter.X,
secondDotCenter.Y + 20f
);
firstDot.Transform = CGAffineTransform.MakeScale (5f, 5f);
},
() => {
firstDot.Center =
new CGPoint (
firstDotCenter.X,
firstDotCenter.Y
);
}
);
UIView.Animate (0.8, 0, UIViewAnimationOptions.CurveEaseInOut | UIViewAnimationOptions.Autoreverse | UIViewAnimationOptions.Repeat,
() => {
secondDot.Center =
new CGPoint (
firstDotCenter.X,
firstDotCenter.Y + 20f
);
secondDot.Transform = CGAffineTransform.MakeScale (5f, 5f);
},
() => {
secondDot.Center =
new CGPoint (
secondDotCenter.X,
secondDotCenter.Y
);
}
);
return loadingView;
}
示例8: CellContentFactoryImplementationForPerson2
UITableViewCell CellContentFactoryImplementationForPerson2()
{
UITableViewCell cc = new UITableViewCell();
UIView uiview_xibless = new UIView();
uiview_xibless.Frame = new RectangleF(0, 0, 750, 44);
UIButton btnDelete;
UILabel lblName;
UILabel lblDate;
btnDelete = UIButton.FromType(UIButtonType.Custom);
btnDelete.Frame = new RectangleF(30, 8, 100, 27);
lblName = new UILabel(new RectangleF(150, 8 + 3, 350, 21));
lblDate = new UILabel(new RectangleF(500, 8 + 3, 150, 21));
//UIControlState = Normal -> default system state for iOS element
//UIControlState = Highlighted -> Highlighted state of a control.
// A control enters this state when a touch enters and exits
// during tracking and when there is a touch up event.
btnDelete.SetTitleColor(UIColor.Green, UIControlState.Normal);
btnDelete.SetTitleColor(UIColor.Orange, UIControlState.Highlighted);
btnDelete.SetTitle("Delete", UIControlState.Normal);
btnDelete.TouchUpInside += (object sender, EventArgs e) =>
{
};
lblName.Text = "Name";
lblDate.Text = DateTime.Now.ToString();
UIView[] views =
{
btnDelete,
lblName,
lblDate
};
uiview_xibless.AddSubviews(views);
UIView content_view = uiview_xibless; // wrap UIView
cc.Bounds = content_view.Bounds;
cc.AddSubview(content_view);
return cc;
}
开发者ID:moljac,项目名称:MonoTouch.Samples,代码行数:48,代码来源:UITabBarControllerWithTabBarOnTopAndTabsContainingDialogViewControllers.ManualXIBless.cs
示例9: BuildEquipmentItemRowDetails
public UIView BuildEquipmentItemRowDetails(int iSectionCounterId, int iPwrIdRowNo, int iEquipRowNo, string sPwrId,
int iAutoId, int iMaximoAssetId, string sStringNo,
string sMake, string sModel, string sSPN, string sDOM,
string sFloor, string sSuite,string sRack, string sSubRack,
string sPosition, string sEquipType, string sSerialNo,
int iEquipmentType, int iDuplicate, bool bNewRow, bool bReadOnly, ref float iHeightToAdd)
{
DateClass dt = new DateClass();
iHeightToAdd = 0.0f;
UIView hdrRow = new UIView();
float iHdrVert = 0.0f;
float iRowHeight = 40f;
UIView[] arrItems = new UIView[8];
UIView[] arrItems2 = new UIView[18];
UIView[] arrItems3 = new UIView[6];
UIView[] arrItems4 = new UIView[7];
UIView vwBlank = new UIView();
UILabel hfSectionCounter = new UILabel();
hfSectionCounter.Text = iSectionCounterId.ToString();
hfSectionCounter.Tag = iEquipmentRowSectionCounterTagId * (iPwrIdRowNo + 1) + (iEquipRowNo + 1);
hfSectionCounter.Hidden = true;
arrItems4[0] = hfSectionCounter;
UILabel hfPwrId = new UILabel();
hfPwrId.Text = sPwrId;
hfPwrId.Tag = iEquipmentRowPwrIdTagId * (iPwrIdRowNo + 1) + (iEquipRowNo + 1);
hfPwrId.Hidden = true;
arrItems4[1] = hfPwrId;
UILabel hfRowStatus = new UILabel();
if (bNewRow)
{
hfRowStatus.Text = "2"; //2 means new
}
else
{
hfRowStatus.Text = "0";
}
hfRowStatus.Tag = iEquipmentRowStatusTagId * (iPwrIdRowNo + 1) + (iEquipRowNo + 1);
hfRowStatus.Hidden = true;
arrItems4[2] = hfRowStatus;
UILabel hfAutoId = new UILabel();
hfAutoId.Text = iAutoId.ToString();
hfAutoId.Tag = iEquipmentRowAutoIdTagId * (iPwrIdRowNo + 1) + (iEquipRowNo + 1);
hfAutoId.Hidden = true;
arrItems4[3] = hfAutoId;
UILabel hfMaximoAssetId = new UILabel();
hfMaximoAssetId.Text = iMaximoAssetId.ToString();
hfMaximoAssetId.Tag = iEquipmentRowMaximoAssetIdTagId * (iPwrIdRowNo + 1) + (iEquipRowNo + 1);
hfMaximoAssetId.Hidden = true;
arrItems4[4] = hfMaximoAssetId;
UILabel hfEquipmentTypeId = new UILabel();
hfEquipmentTypeId.Text = iEquipmentType.ToString();
hfEquipmentTypeId.Tag = iEquipmentTypeTagId * (iPwrIdRowNo + 1) + (iEquipRowNo + 1);
hfEquipmentTypeId.Hidden = true;
arrItems4[5] = hfEquipmentTypeId;
UILabel hfDuplicateId = new UILabel();
hfDuplicateId.Text = iDuplicate.ToString();
hfDuplicateId.Tag = iDuplicateTagId * (iPwrIdRowNo + 1) + (iEquipRowNo + 1);
hfDuplicateId.Hidden = true;
arrItems4[6] = hfDuplicateId;
hdrRow.AddSubviews(arrItems4);
//***************************************************************//
// 1st Row //
//***************************************************************//
iUtils.CreateFormGridItem lblFloor = new iUtils.CreateFormGridItem();
UIView lblFloorVw = new UIView();
lblFloor.SetDimensions(0f, iHdrVert, 50f, iRowHeight, 2f, 2f, 2f, 2f);
lblFloor.SetLabelText(sFloor);
lblFloor.SetBorderWidth(0.0f);
lblFloor.SetFontName("Verdana");
lblFloor.SetFontSize(12f);
lblFloor.SetTag(iEquipmentFloorTagId * (iPwrIdRowNo + 1) + (iEquipRowNo + 1));
if (iPwrIdRowNo % 2 == 0)
{
lblFloor.SetCellColour("Pale Yellow");
}
else
{
lblFloor.SetCellColour("Pale Orange");
}
lblFloorVw = lblFloor.GetTextFieldCell();
UITextField txtFloorView = lblFloor.GetTextFieldView();
txtFloorView.AutocorrectionType = UITextAutocorrectionType.No;
txtFloorView.KeyboardType = UIKeyboardType.NumbersAndPunctuation;
txtFloorView.ShouldBeginEditing += (sender) => {
return SetGlobalEditItems(sender, 1);};
txtFloorView.ReturnKeyType = UIReturnKeyType.Next;
txtFloorView.ShouldEndEditing += (sender) => {
return ValidateFloor(sender, 0);};
//.........这里部分代码省略.........
示例10: ShowPicker
public void ShowPicker ()
{
actionSheet = new UIView () {
BackgroundColor = UIColor.Clear
};
UIView parentView = UIApplication.SharedApplication.KeyWindow.RootViewController.View;
// Creates a transparent grey background who catches the touch actions (and add more style).
UIView dimBackgroundView = new UIView (parentView.Bounds) {
BackgroundColor = UIColor.Gray.ColorWithAlpha (0.5f)
};
const float titleBarHeight = 44;
var actionSheetSize = new SizeF ((float)parentView.Frame.Width, (float)this.Frame.Height + titleBarHeight);
var actionSheetFrameHidden = new CGRect (0, parentView.Frame.Height, actionSheetSize.Width, actionSheetSize.Height);
var actionSheetFrameDisplayed = new CGRect (0, parentView.Frame.Height - actionSheetSize.Height, actionSheetSize.Width, actionSheetSize.Height);
// Hide the action sheet before we animate it so it comes from the bottom.
actionSheet.Frame = actionSheetFrameHidden;
this.Frame = new RectangleF (0, 1, actionSheetSize.Width, actionSheetSize.Height - titleBarHeight);
var toolbarPicker = new UIToolbar (new CGRect (0, 0, actionSheet.Frame.Width, titleBarHeight)) {
ClipsToBounds = true,
Items = new UIBarButtonItem[] {
new UIBarButtonItem (UIBarButtonSystemItem.FlexibleSpace),
new UIBarButtonItem (UIBarButtonSystemItem.Done, (sender, args) => {
UIView.Animate (.25,
() => {
actionSheet.Frame = actionSheetFrameHidden;
},
() => {
dimBackgroundView.RemoveFromSuperview ();
actionSheet.RemoveFromSuperview ();
});
})
}
};
// Creates a blur background using the toolbar trick.
var toolbarBg = new UIToolbar (new CGRect (0, 0, actionSheet.Frame.Width, actionSheet.Frame.Height)) {
ClipsToBounds = true
};
actionSheet.AddSubviews (new UIView[] { toolbarBg, this, toolbarPicker });
parentView.AddSubviews (new UIView[] { dimBackgroundView, actionSheet });
parentView.BringSubviewToFront (actionSheet);
UIView.Animate (.25, () => {
actionSheet.Frame = actionSheetFrameDisplayed;
});
}
示例11: BuildEquipmentHeader
//.........这里部分代码省略.........
if (iRowNo % 2 == 0)
{
lblSerialNo.SetCellColour("Pale Yellow");
}
else
{
lblSerialNo.SetCellColour("Pale Orange");
}
lblSerialNoVw = lblSerialNo.GetLabelCell();
arrItems2[8] = lblSerialNoVw;
iUtils.CreateFormGridItem lblDeleteLabel = new iUtils.CreateFormGridItem();
UIView lblDeleteLabelVw = new UIView();
lblDeleteLabel.SetDimensions(880f,iHdrVert, 120f, iRowHeight, 2f, 2f, 2f, 2f);
lblDeleteLabel.SetLabelText("Delete");
lblDeleteLabel.SetBorderWidth(1.0f);
lblDeleteLabel.SetFontName("Verdana");
lblDeleteLabel.SetFontSize(12f);
lblDeleteLabel.SetTag(iDeleteEquipLabelTagId * (iRowNo+1));
if (iRowNo % 2 == 0)
{
lblDeleteLabel.SetCellColour("Pale Yellow");
}
else
{
lblDeleteLabel.SetCellColour("Pale Orange");
}
lblDeleteLabelVw = lblDeleteLabel.GetLabelCell();
arrItems2[9] = lblDeleteLabelVw;
hdrRow.AddSubviews(arrItems2);
iHeightToAdd += iRowHeight - 1; //This is because of the 1 pixel overlap of the border (not required on the last one)
iHdrVert += iRowHeight - 1; //This is because of the 1 pixel overlap of the border (not required on the last one)
iUtils.CreateFormGridItem lblMake = new iUtils.CreateFormGridItem();
UIView lblMakeVw = new UIView();
lblMake.SetDimensions(0f,iHdrVert, 401f, iRowHeight, 2f, 2f, 2f, 2f); //Set left to 1 less so border does not double up
lblMake.SetLabelText("Make");
lblMake.SetBorderWidth(1.0f);
lblMake.SetFontName("Verdana");
lblMake.SetFontSize(12f);
lblMake.SetTag(iMakeEquipLabelTagId * (iRowNo+1));
if (iRowNo % 2 == 0)
{
lblMake.SetCellColour("Pale Yellow");
}
else
{
lblMake.SetCellColour("Pale Orange");
}
lblMakeVw = lblMake.GetLabelCell();
arrItems[0] = lblMakeVw;
iUtils.CreateFormGridItem lblModel = new iUtils.CreateFormGridItem();
UIView lblModelVw = new UIView();
lblModel.SetDimensions(400f,iHdrVert, 501f, iRowHeight, 2f, 2f, 2f, 2f); //Set left to 1 less so border does not double up
lblModel.SetLabelText("Model");
lblModel.SetBorderWidth(1.0f);
lblModel.SetFontName("Verdana");
lblModel.SetFontSize(12f);
示例12: DrawOpeningPage
//.........这里部分代码省略.........
btnContractEquipment.SetDimensions(750f,0f, 50f, iSectionHdrRowHeight, 8f, 4f, 8f, 4f);
btnContractEquipment.SetLabelText("-");
btnContractEquipment.SetBorderWidth(0.0f);
btnContractEquipment.SetFontName("Verdana");
btnContractEquipment.SetFontSize(12f);
btnContractEquipment.SetTag(iContractSectionBtnTagId * (iii+1));
btnContractEquipment.SetCellColour("DarkSlateGrey");
btnContractEquipmentVw = btnContractEquipment.GetButtonCell();
UIButton btnContractEquipmentButton = new UIButton();
btnContractEquipmentButton = btnContractEquipment.GetButton();
btnContractEquipmentButton.TouchUpInside += (sender,e) => {ContractSection(sender, e);};
arrItems4[4] = btnContractEquipmentVw;
UILabel hfSectionEquipmentHeight = new UILabel();
hfSectionEquipmentHeight.Tag = iSectionHeightTagId * (iii+1);
hfSectionEquipmentHeight.Hidden = true;
hfSectionEquipmentHeight.Text = "0";
arrItems4[5] = hfSectionEquipmentHeight;
UILabel hfSectionEquipmentRows = new UILabel();
hfSectionEquipmentRows.Tag = iSectionRowsTagId * (iii+1);
hfSectionEquipmentRows.Hidden = true;
hfSectionEquipmentRows.Text = iPwrIdRows.ToString();
arrItems4[6] = hfSectionEquipmentRows;
UILabel hfSectionEquipmentStatus = new UILabel();
hfSectionEquipmentStatus.Tag = iSectionStatusTagId * (iii+1);
hfSectionEquipmentStatus.Hidden = true;
hfSectionEquipmentStatus.Text = "0";
arrItems4[7] = hfSectionEquipmentStatus;
SectionEquipmentRow.AddSubviews(arrItems4);
iVert += iSectionHdrRowHeight;
//Now add a new view to this view to hold another view containing all the pwrid info for this section 10
UIView PwrIdTableRow = new UIView();
PwrIdTableRow.Frame = new RectangleF(0f,iVert,1000f,iSectionHdrRowHeight);
iSectionId = iContainerSectionTagId * (iii+1);
PwrIdTableRow.Tag = iSectionId;
layout.AddSubview(PwrIdTableRow);
float iPwrIdRowVert = 0.0f;
float iSectionPwrIdHeight = 0.0f;
float iPwrIdRowVertTop = iVert;
float iPwrIdRowInnerTop = 0.0f;
float iPwrIdRowInnerTop2 = 0.0f;
m_iEquipmentPwrIds = iPwrIdRows;
for (int jj = 0; jj < iPwrIdRows; jj++)
{
iPwrIdRowInnerTop2 = 0.0f;
UIView vwPwrInternalRowId = new UIView();
vwPwrInternalRowId.Frame = new RectangleF(0f,iPwrIdRowVert,1000f,200f); //This will be resized later on
vwPwrInternalRowId.Tag = (iPwrIdSectionTagId + (jj+1)) * (iii+1);
UILabel hfRow10Status = new UILabel();
hfRow10Status.Text = "0";
hfRow10Status.Tag = (ihfRow10StatusTagId + (jj+1)) * (iii+1);
hfRow10Status.Hidden = true;
arrItems5[0] = hfRow10Status;
//Put in the PwrId Label
iUtils.CreateFormGridItem rowPwrIdLabel = new iUtils.CreateFormGridItem();
示例13: ShowAboutView
private void ShowAboutView()
{
var captionLabel = UIHelper.CreateLabel (
"about",
true,
32,
32,
UITextAlignment.Center,
UIColor.Black
);
captionLabel.Frame = new Rectangle (0, 10, 320, 40);
UIView header = new UIView (new Rectangle (0, 0, 300, 40));
header.AddSubviews (captionLabel);
var closeButton = new StyledStringElement ("Close");
closeButton.BackgroundColor = UIColor.LightGray;
closeButton.Alignment = UITextAlignment.Center;
closeButton.Tapped += delegate {
navigation.DismissModalViewControllerAnimated(true);
};
var root = new RootElement ("About")
{
new Section (header),
new Section(UIHelper.CreateHtmlView("About.html", 290f, 300f)),
new Section()
{
closeButton
}
};
root.UnevenRows = true;
var dvc = new StyledDialogViewController (root, null, backgroundColor)
{
Autorotate = true,
};
navigation.PresentModalViewController(dvc, true);
}
示例14: ThreeDotLoadingZooming
public static UIView ThreeDotLoadingZooming(CGRect frame)
{
var loadingView = new UIView (new CGRect ((frame.Width - _padding) / 2f, _padding * 4.5, _padding, _padding));
var dotDiameter = 6f;
var padding = 5.5f;
UIView middleDot = new UIView (new CGRect (
(loadingView.Frame.Width - dotDiameter) / 2f,
(loadingView.Frame.Height - dotDiameter) / 2f,
dotDiameter,
dotDiameter
));
middleDot.Layer.CornerRadius = dotDiameter / 2f;
middleDot.BackgroundColor = UIColor.Gray;
UIView leftDot = new UIView (
new CGRect (
middleDot.Frame.Left - dotDiameter - padding,
middleDot.Frame.Y,
dotDiameter,
dotDiameter
));
leftDot.Layer.CornerRadius = dotDiameter / 2f;
leftDot.BackgroundColor = UIColor.Gray;
UIView rightDot = new UIView (
new CGRect (
middleDot.Frame.Right + padding,
middleDot.Frame.Y,
dotDiameter,
dotDiameter
));
rightDot.Layer.CornerRadius = dotDiameter / 2f;
rightDot.BackgroundColor = UIColor.Gray;
loadingView.AddSubviews (middleDot, leftDot, rightDot);
leftDot.Alpha = 0.5f;
middleDot.Alpha = 0.5f;
rightDot.Alpha = 0.5f;
UIView.Animate (0.6, 0, UIViewAnimationOptions.Repeat | UIViewAnimationOptions.Autoreverse, () => {
leftDot.Transform = CGAffineTransform.MakeScale (1.8f, 1.8f);
leftDot.Alpha = 1f;
}, null);
UIView.Animate (0.6, 0.2, UIViewAnimationOptions.Repeat | UIViewAnimationOptions.Autoreverse, () => {
middleDot.Transform = CGAffineTransform.MakeScale (1.8f, 1.8f);
middleDot.Alpha = 1f;
}, null);
UIView.Animate (0.6, 0.4, UIViewAnimationOptions.Repeat | UIViewAnimationOptions.Autoreverse, () => {
rightDot.Transform = CGAffineTransform.MakeScale (1.8f, 1.8f);
rightDot.Alpha = 1f;
}, null);
return loadingView;
}
示例15: ToUIView
public static UIView ToUIView(this Stage stage)
{
var view = new UIView () {
};
stage.NaviveViews ["Stage"] = view;
view.AddSubviews (stage.Content.Select (x => (UIView)(stage.NaviveViews[x.Name] = x.ToUIView ())).ToArray());
stage.SetState (stage.InitialState, view);
return view;
}