本文整理汇总了C#中UIScrollView.AddSubviews方法的典型用法代码示例。如果您正苦于以下问题:C# UIScrollView.AddSubviews方法的具体用法?C# UIScrollView.AddSubviews怎么用?C# UIScrollView.AddSubviews使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIScrollView
的用法示例。
在下文中一共展示了UIScrollView.AddSubviews方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EditTripScreenView
//.........这里部分代码省略.........
};
_tripNameTextField = new UITextField () {
Placeholder = "trip name",
BorderStyle = UITextBorderStyle.None,
Font = UIFont.FromName("AvenirNext-Medium", 16f),
TextColor = UIColor.Black,
BackgroundColor = UIColor.White
};
_btnStartDate = UIButton.FromType (UIButtonType.Custom);
_btnStartDate.SetTitle ("from Wednessday, Jul 17, 2013", UIControlState.Normal);
_btnStartDate.SetTitleColor (UIColor.White, UIControlState.Normal);
_btnStartDate.SetTitleColor (UIColor.LightGray, UIControlState.Highlighted);
_btnStartDate.Font = UIFont.FromName ("AvenirNext-Medium", 16f);
actionSheetDatePickerStartDate = new ActionSheetDatePicker (this);
actionSheetDatePickerStartDate.Title = "Choose Date:";
actionSheetDatePickerStartDate.DatePicker.Mode = UIDatePickerMode.Date;
actionSheetDatePickerStartDate.DatePicker.ValueChanged += (sender, e) => {
DateTime selectedDate = (sender as UIDatePicker).Date;
_btnStartDate.SetTitle(selectedDate.ToString("D"), UIControlState.Normal);
};
_btnStartDate.TouchUpInside += (sender, e) => {
actionSheetDatePickerStartDate.Show();
};
_btnEndDate = UIButton.FromType (UIButtonType.Custom);
_btnEndDate.SetTitle ("to Wednessday, Jul 17, 2013", UIControlState.Normal);
_btnEndDate.SetTitleColor (UIColor.White, UIControlState.Normal);
_btnEndDate.SetTitleColor (UIColor.LightGray, UIControlState.Highlighted);
_btnEndDate.Font = UIFont.FromName ("AvenirNext-Medium", 16f);
_btnEndDate.TouchUpInside += (sender, e) => {
actionSheetDatePickerEndDate.Show();
};
actionSheetDatePickerEndDate = new ActionSheetDatePicker (this);
actionSheetDatePickerEndDate.Title = "Choose Date:";
actionSheetDatePickerEndDate.DatePicker.Mode = UIDatePickerMode.Date;
actionSheetDatePickerEndDate.DatePicker.ValueChanged += (sender, e) => {
DateTime selectedDate = (sender as UIDatePicker).Date;
_btnEndDate.SetTitle(selectedDate.ToString("D"), UIControlState.Normal);
};
_tripDescTextField = new UITextView () {
Font = UIFont.FromName("AvenirNext-Medium", 16f),
TextColor = UIColor.Black,
BackgroundColor = UIColor.White,
Text = "Desc"
};
_tripBudgetTextField = new UITextField () {
Placeholder = "budget",
BorderStyle = UITextBorderStyle.None,
Font = UIFont.FromName("AvenirNext-Medium", 16f),
TextColor = UIColor.Black,
BackgroundColor = UIColor.White,
KeyboardType = UIKeyboardType.NumberPad
};
ButtonExpenses = UIButton.FromType (UIButtonType.RoundedRect);
ButtonExpenses.SetTitle ("expenses", UIControlState.Normal);
ButtonDeleteTrip = UIButton.FromType (UIButtonType.RoundedRect);
ButtonDeleteTrip.SetTitle ("delete trip", UIControlState.Normal);
_tripNameTextField.SizeToFit ();
_btnStartDate.SizeToFit ();
_btnEndDate.SizeToFit ();
_tripDescTextField.SizeToFit ();
_tripBudgetTextField.SizeToFit ();
ButtonExpenses.SizeToFit ();
ButtonDeleteTrip.SizeToFit();
_tripNameTextField.ShouldReturn += (t) => {
t.ResignFirstResponder();
return true;
};
// set content size to default for now
//TODO: implement observer and set accordingly
_scrollView.ContentSize = new SizeF (frame.Width, frame.Height);
_scrollView.AddSubviews (_tripNameTextField, _btnStartDate,
_btnEndDate, _tripDescTextField,
_tripBudgetTextField, ButtonExpenses, ButtonDeleteTrip);
_scrollView.SizeToFit ();
_scrollView.BackgroundColor = this.BackgroundColor = UIColor.DarkGray;
this.AddSubview ( _scrollView);
}
示例2: InitSubviews
private void InitSubviews ()
{
FitpulseTheme.Apply (View);
scrollView = new UIScrollView (UIScreen.MainScreen.Bounds);
Add (scrollView);
if (UISwitch.Appearance.RespondsToSelector (new Selector ("onImage"))) {
} else {
bool showSwitchText = !UIDevice.CurrentDevice.CheckSystemVersion (7, 0);
var onRect = new CGRect (72, 20, 76, 42);
var offRect = new CGRect (176, 20, 76, 42);
if (!showSwitchText) {
onRect.X += 20;
onRect.Width -= 20;
offRect.Width -= 20;
}
var onSwitch = new SwitchOnOff (onRect);
onSwitch.SetOn (true);
var offSwitch = new SwitchOnOff (offRect);
offSwitch.SetOn (false);
onSwitch.ShowText (showSwitchText);
offSwitch.ShowText (showSwitchText);
scrollView.AddSubviews (onSwitch, offSwitch);
}
progressBar = new PercentageProgressBar (new CGRect (20, 68, 280, 24));
progressBar.Progress = 0.5f;
scrollView.Add (progressBar);
var loadingLabel = new UILabel (new CGRect (118, 91, 84, 19));
loadingLabel.Text = "Loading...";
loadingLabel.Font = UIFont.BoldSystemFontOfSize (15);
loadingLabel.TextColor = UIColor.FromRGB (135, 141, 138);
loadingLabel.BackgroundColor = UIColor.Clear;
loadingLabel.TextAlignment = UITextAlignment.Center;
scrollView.Add (loadingLabel);
slider = new UISlider (new CGRect (18, 121, 284, 23));
slider.MinValue = 0;
slider.MaxValue = 1;
slider.Value = 0.5f;
slider.ValueChanged += (sender, e) => {
progressBar.Progress = slider.Value; };
scrollView.Add (slider);
var uiSegmentedControl = new UISegmentedControl (new [] {"Yes", "No", "Maybe"}) {
SelectedSegment = 0
};
FitpulseTheme.Apply (uiSegmentedControl);
uiSegmentedControl.SetWidth (80.0f, 0);
uiSegmentedControl.SetWidth (80.0f, 1);
uiSegmentedControl.Frame = new CGRect (26, 161, 268, 44);
scrollView.Add (uiSegmentedControl);
textField = new UITextField (new CGRect (20, 221, 280, 31));
textField.LeftView = new UIView (new CGRect (0, 0, 5, 31));
textField.LeftViewMode = UITextFieldViewMode.Always;
textField.Font = UIFont.SystemFontOfSize (14);
textField.TextColor = UIColor.White;
textField.Background = UIImage.FromFile ("text-input.png");
textField.VerticalAlignment = UIControlContentVerticalAlignment.Center;
textField.Placeholder = "Text";
FitpulseTheme.Apply (textField);
textField.Delegate = new TextFieldDelegate ();
scrollView.Add (textField);
var leftTopButton = Buttons.ElementsButton ("Button", FitpulseTheme.SharedTheme.GrayButtonImage);
var rightTopButton = Buttons.ElementsButton ("Button", FitpulseTheme.SharedTheme.GrayPressedButtonImage);
var leftBottomButton = Buttons.ElementsButton ("Button", FitpulseTheme.SharedTheme.BlueButtonImage);
var rightBottomButton = Buttons.ElementsButton ("Button", FitpulseTheme.SharedTheme.BluePressedButtonImage);
leftBottomButton.SetTitleColor (UIColor.White, UIControlState.Normal);
leftBottomButton.SetTitleColor (UIColor.DarkGray, UIControlState.Highlighted);
rightBottomButton.SetTitleColor (UIColor.White, UIControlState.Normal);
rightBottomButton.SetTitleColor (UIColor.DarkGray, UIControlState.Highlighted);
leftBottomButton.SetTitleShadowColor (UIColor.DarkGray, UIControlState.Normal);
leftBottomButton.SetTitleShadowColor (UIColor.Gray, UIControlState.Highlighted);
rightBottomButton.SetTitleShadowColor (UIColor.DarkGray, UIControlState.Normal);
rightBottomButton.SetTitleShadowColor (UIColor.Gray, UIControlState.Highlighted);
leftTopButton.Frame = new CGRect (20, 268, 126, 42);
leftBottomButton.Frame = new CGRect (20, 318, 126, 42);
rightTopButton.Frame = new CGRect (174, 268, 126, 42);
rightBottomButton.Frame = new CGRect (174, 318, 126, 42);
//.........这里部分代码省略.........
示例3: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad();
MainView = new UIView();
scrollView = new UIScrollView();
imageView = new UIImageView();
imageView.BackgroundColor = UIColor.Black;
textView = new UITextView();
textView.Editable = false;
textView.BackgroundColor = UIColor.Black;
textView.TextColor = UIColor.White;
scrollView.AddSubviews(new UIView[] { imageView, textView });
this.View.AddSubview(scrollView);
}
示例4: DrawOpeningPage
//.........这里部分代码省略.........
lblBackupHdr.SetFontSize(12f);
lblBackupHdr.SetCellColour("DarkSlateGrey");
lblBackupHdr.SetTextColour("White");
lblBackupHdr.SetTextAlignment("centre");
lblBackupHdrVw = lblBackupHdr.GetLabelCell();
arrItems[4] = lblBackupHdrVw;
iUtils.CreateFormGridItem lblRemoveHdr = new iUtils.CreateFormGridItem();
UIView lblRemoveHdrVw = new UIView();
lblRemoveHdr.SetDimensions(655f,iVert,100f, iRowHeight, 2f, 2f, 2f, 2f); //Set left to 1 less so border does not double up
lblRemoveHdr.SetLabelText("Remove");
lblRemoveHdr.SetBorderWidth(1.0f);
lblRemoveHdr.SetFontName("Verdana-Bold");
lblRemoveHdr.SetFontSize(12f);
lblRemoveHdr.SetCellColour("DarkSlateGrey");
lblRemoveHdr.SetTextColour("White");
lblRemoveHdr.SetTextAlignment("centre");
lblRemoveHdrVw = lblRemoveHdr.GetLabelCell();
arrItems[5] = lblRemoveHdrVw;
iUtils.CreateFormGridItem lblStatusHdr = new iUtils.CreateFormGridItem();
UIView lblStatusHdrVw = new UIView();
lblStatusHdr.SetDimensions(754f,iVert,246f, iRowHeight, 2f, 2f, 2f, 2f); //Set left to 1 less so border does not double up
lblStatusHdr.SetLabelText("Status");
lblStatusHdr.SetBorderWidth(1.0f);
lblStatusHdr.SetFontName("Verdana-Bold");
lblStatusHdr.SetFontSize(12f);
lblStatusHdr.SetCellColour("DarkSlateGrey");
lblStatusHdr.SetTextColour("White");
lblStatusHdr.SetTextAlignment("centre");
lblStatusHdrVw = lblStatusHdr.GetLabelCell();
arrItems[6] = lblStatusHdrVw;
layout.AddSubviews(arrItems);
//Loop around for each item and place in the psuedo table
DataSet arrITP = GetITPsDownloadedLocal();
if(arrITP.Tables.Count >0)
{
UIView[] arrItems2 = new UIView[10];
int iRows = arrITP.Tables[0].Rows.Count;
m_iProjectsInList = iRows;
iTotalHeight = (iRows+1) * iRowHeight;
for (int i = 0; i < iRows; i++)
{
sStatusText = "";
iVert += (iRowHeight - 1.0f); //Make it 1 less so that the border does not double up
iUtils.CreateFormGridItem lblProjId = new iUtils.CreateFormGridItem();
UIView lblProjIdVw = new UIView();
lblProjId.SetDimensions(10f,iVert, 100f, iRowHeight, 2f, 2f, 2f, 2f);
iColNo = arrITP.Tables[0].Columns["ID"].Ordinal;
sId = arrITP.Tables[0].Rows[i].ItemArray[iColNo].ToString();
lblProjId.SetLabelText(sId);
lblProjId.SetBorderWidth(1.0f);
lblProjId.SetFontName("Verdana");
lblProjId.SetFontSize(12f);
lblProjId.SetTag(iProjectIdTagId * (i+1));
lblProjIdVw = lblProjId.GetLabelCell();
arrItems2[0] = lblProjIdVw;
iUtils.CreateFormGridItem lblDesc = new iUtils.CreateFormGridItem();
UIView lblDescVw = new UIView();
lblDesc.SetDimensions(109f,iVert, 250f, iRowHeight, 2f, 2f, 2f, 2f); //Set left to 1 less so border does not double up
iColNo = arrITP.Tables[0].Columns["ProjectDesc"].Ordinal;
示例5: GetPage
public UIViewController GetPage(int i)
{
var card = _GetOrderedCardByIndex(i);
UIViewController viewController = new ScrollableViewController();
viewController.View.BackgroundColor = ScreenResolutionMatcher.BackgroundColorFromImage();
_scrollView = new UIScrollView() {
Frame = ScreenResolutionMatcher.FullViewFrame(),
ContentSize = ScreenResolutionMatcher.ViewFrame(),
ScrollEnabled = true
};
_scrollView.AddSubview(new CardView(card));
var matchDetailView = new MatchDetailView();
int verticalOffset = 68 + ScreenResolutionMatcher.ContentViewStartingY();
int offset = (card.Matches.Count <= 10) ? 28 : 26;
if (card.IsEditable()) {
var sorted_matches = card.Matches.OrderBy(m => m.MatchId);
foreach (var match in sorted_matches) {
UIView[] matches;
if (card.IsKnockout) {
if (match.IsEditable ())
matches = matchDetailView.BuildForEdit (match, verticalOffset);
else if (match.HasRealScore())
matches = matchDetailView.BuildForPublished(match, verticalOffset);
else
matches = matchDetailView.BuildForReadOnly(match, verticalOffset);
}
else
matches = matchDetailView.BuildForEdit(match, verticalOffset);
verticalOffset += offset;
_scrollView.AddSubviews(matches);
}
var submitCardButton = new GlassButton(new RectangleF (10, ScreenResolutionMatcher.PushedToBottomButtonY(), 300, 40)) {
NormalColor = UIColor.FromRGBA(222/255f, 222/255f, 225/255f, 0.25f),
HighlightedColor = UIColor.Black
};
submitCardButton.SetTitle("Guardar Tarjeta", UIControlState.Normal);
submitCardButton.Font = UIFont.BoldSystemFontOfSize(14);
submitCardButton.Tapped += delegate(GlassButton button) {
var firstResponder = button.Superview.FindFirstResponder();
if (firstResponder != null)
firstResponder.ResignFirstResponder();
//app could have been open for a while, and card might no longer be editable
if (card.IsEditable()) {
if (card.IsKnockout) { card = StripOverdueMatches(card); }
AppManager.Current.CardsService.SubmitCard(card);
}
else
new UIAlertView(Constants.APP_TITLE, "La fecha ya ha cerrado.", null, "Ok").Show();
};
_scrollView.AddSubview(submitCardButton);
}
else if (card.IsPublished()) {
foreach (var match in card.Matches) {
var matches = matchDetailView.BuildForPublished(match, verticalOffset);
verticalOffset += offset;
_scrollView.AddSubviews(matches);
}
_scrollView.AddSubview(
new UILabel{
Text = string.Format("Fecha cerrada. Obtuviste {0} puntos!", card.Points),
TextAlignment = UITextAlignment.Center,
Frame = new RectangleF(10,ScreenResolutionMatcher.PushedToBottomButtonY(),300,40),
TextColor = UIColor.White,
Font = UIFont.BoldSystemFontOfSize(17),
BackgroundColor = UIColor.Clear
});
}
else {
foreach (var match in card.Matches) {
var matches = matchDetailView.BuildForReadOnly(match, verticalOffset);
verticalOffset += offset;
_scrollView.AddSubviews(matches);
}
_scrollView.AddSubview(
new UILabel{
Text = "Fecha cerrada. Pronto sabrás tus puntos!",
TextAlignment = UITextAlignment.Center,
Frame = new RectangleF(10,ScreenResolutionMatcher.PushedToBottomButtonY(),300,40),
TextColor = UIColor.White,
Font = UIFont.BoldSystemFontOfSize(15),
BackgroundColor = UIColor.Clear
});
}
if (card.IsKnockout) {
_scrollView.AddSubview(
new UILabel{
Text = string.Format("Total tarjeta Brasil 2014: {0} puntos!", card.Points),
TextAlignment = UITextAlignment.Center,
Frame = new RectangleF(10,ScreenResolutionMatcher.PushedToBottomButtonY()-40,300,40),
//.........这里部分代码省略.........