public override UIView ViewForItem(CarouselView carousel, uint index, UIView reusingView) { UILabel label; if (reusingView == null) { var imgView = new UIImageView(new RectangleF(0, 0, 200, 200)) { Image = FromUrl( index > 1 ? product[0].ImageForSize(250) : product[(int)index].ImageForSize(250) ), ContentMode = UIViewContentMode.Center }; label = new UILabel(imgView.Bounds) { BackgroundColor = UIColor.Clear, TextAlignment = UITextAlignment.Center, Tag = 1 }; label.Font = label.Font.WithSize(50); imgView.AddSubview(label); reusingView = imgView; } else { label = (UILabel)reusingView.ViewWithTag(1); } return reusingView; }
void Start () { root = GameObject.Find("UI Root"); gm = GameObject.Find("GameManager").GetComponent<GameManager>(); nameLabel = root.transform.Find("Avg_Panel/Label_Name").GetComponent<UILabel>(); dialogLabel = root.transform.Find("Avg_Panel/Label_Dialog").GetComponent<UILabel>(); nameLabel.fontSize = 22; }
public override void ViewDidLoad() { base.ViewDidLoad(); View.BackgroundColor = UIColor.White; var gameNameLabel = new UILabel(new RectangleF(10, 80, View.Frame.Width - 20, 20)); gameNameLabel.Text = "Spartakiade Quiz"; View.AddSubview(gameNameLabel); var playname = new UITextView(new RectangleF(10, 110, View.Frame.Width - 20, 20)); playname.BackgroundColor = UIColor.Brown; View.AddSubview(playname); var btnStartGame = new UIButton(new RectangleF(10, 140, View.Frame.Width - 20, 20)); btnStartGame.SetTitle("Start game", UIControlState.Normal); btnStartGame.BackgroundColor = UIColor.Blue; btnStartGame.TouchUpInside += delegate { NavigationController.PushViewController(new PlayGameController(playname.Text), true); }; View.AddSubview(btnStartGame); }
public void LoadView() { mBox = new UIBox(UIConstants.BoxRect, UIConstants.MainBackground); mBackgroundTextureLabel = new UILabel(UIConstants.RectLabelOne, UIConstants.CloudRecognition); string [] extendedTrackingStyle = {UIConstants.ExtendedTrackingStyleOff, UIConstants.ExtendedTrackingStyleOn}; mExtendedTracking = new UICheckButton(UIConstants.RectOptionOne, false, extendedTrackingStyle); string[] aboutStyles = { UIConstants.AboutLableStyle, UIConstants.AboutLableStyle }; mAboutLabel = new UICheckButton(UIConstants.RectLabelAbout, false, aboutStyles); string[] cameraFlashStyles = {UIConstants.CameraFlashStyleOff, UIConstants.CameraFlashStyleOn}; mCameraFlashSettings = new UICheckButton(UIConstants.RectOptionThree, false, cameraFlashStyles); string[] autofocusStyles = {UIConstants.AutoFocusStyleOff, UIConstants.AutoFocusStyleOn}; mAutoFocusSetting = new UICheckButton(UIConstants.RectOptionTwo, false, autofocusStyles); mCameraLabel = new UILabel(UIConstants.RectLabelTwo, UIConstants.CameraLabelStyle); string[,] cameraFacingStyles = new string[2,2] {{UIConstants.CameraFacingFrontStyleOff, UIConstants.CameraFacingFrontStyleOn},{ UIConstants.CameraFacingRearStyleOff, UIConstants.CameraFacingRearStyleOn}}; UIRect[] cameraRect = { UIConstants.RectOptionFour, UIConstants.RectOptionFive }; mCameraFacing = new UIRadioButton(cameraRect, 1, cameraFacingStyles); string[] closeButtonStyles = {UIConstants.closeButtonStyleOff, UIConstants.closeButtonStyleOn }; mCloseButton = new UIButton(UIConstants.CloseButtonRect, closeButtonStyles); }
// Use this for initialization void Start () { uiSprite = thumbImgaeObject.GetComponent<UI2DSprite>(); uiLabelName = placeNameObject.GetComponent<UILabel>(); uiLabelInfo = placeInfoObject.GetComponent<UILabel>(); spr = Resources.LoadAll<Sprite>("Background"); }
private LoadingIndicator() : base() { int ScreenWidth = Platform.ScreenWidth; int ScreenHeight = Platform.ScreenHeight - 80; const int Padding = 10; const int TextWidth = 65; const int SpinnerSize = 20; const int SeparateWidth = 5; const int Width = Padding + SpinnerSize + SeparateWidth + TextWidth + Padding; const int Height = Padding + SpinnerSize + Padding; Frame = new RectangleF((ScreenWidth - Width) / 2, ScreenHeight / 2, Width, Height); BackgroundColor = UIColor.FromWhiteAlpha(0.5f, 0.5f); spinner = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.WhiteLarge) { Frame = new RectangleF(Padding, Padding, SpinnerSize, SpinnerSize) }; label = new UILabel { Frame = new RectangleF(Padding + SpinnerSize + SeparateWidth, Padding, TextWidth, SpinnerSize), Text = "Loading...", TextColor = StyleExtensions.lightGrayText, BackgroundColor = StyleExtensions.transparent, AdjustsFontSizeToFitWidth = true }; AddSubview(label); AddSubview(spinner); Hidden = true; }
public override void ViewDidLoad() { View = new UIView(){ BackgroundColor = UIColor.White}; base.ViewDidLoad(); var label = new UILabel(new RectangleF(10, 10, 300, 40)); Add(label); var textField = new UITextField(new RectangleF(10, 50, 300, 40)); Add(textField); var button = new UIButton(UIButtonType.RoundedRect); button.SetTitle("Click Me", UIControlState.Normal); button.Frame = new RectangleF(10, 90, 300, 40); Add(button); var button2 = new UIButton(UIButtonType.RoundedRect); button2.SetTitle("Go Second", UIControlState.Normal); button2.Frame = new RectangleF(10, 130, 300, 40); Add(button2); var set = this.CreateBindingSet<FirstView, Core.ViewModels.FirstViewModel>(); set.Bind(label).To(vm => vm.Hello); set.Bind(textField).To(vm => vm.Hello); set.Bind(button).To(vm => vm.MyCommand); set.Bind(button2).To(vm => vm.GoSecondCommand); set.Apply(); }
public override UITableViewCell GetCell(UITableView tv) { RectangleF frame; if (datePicker == null) { label = new UILabel { Text = Caption }; label.SizeToFit(); frame = label.Frame; frame.X = 15; frame.Y = 5; label.Frame = frame; datePicker = CreatePicker(); } if(datePicker.Date != DateValue) datePicker.Date = DateValue; frame = datePicker.Frame; frame.Y = frame.X = 0; datePicker.Frame = frame; var cell = tv.DequeueReusableCell("datePicker") ?? new UITableViewCell(UITableViewCellStyle.Default, "datePicker") { Accessory = UITableViewCellAccessory.None }; cell.ContentView.Add(label); if(cell.ContentView != datePicker.Superview) cell.ContentView.Add(datePicker); return cell; }
private void Initialize() { BackgroundColor = GlobalTheme.BackgroundColor; _lblFrequency = new UILabel(new RectangleF(12, 4, 60, 36)); _lblFrequency.BackgroundColor = UIColor.Clear; _lblFrequency.TextColor = UIColor.White; _lblFrequency.Font = UIFont.FromName("HelveticaNeue-Light", 12.0f); _lblValue = new UILabel(new RectangleF(UIScreen.MainScreen.Bounds.Width - 60 - 14, 4, 60, 36)); _lblValue.BackgroundColor = UIColor.Clear; _lblValue.Text = "0.0 dB"; _lblValue.TextColor = UIColor.White; _lblValue.TextAlignment = UITextAlignment.Right; _lblValue.Font = UIFont.FromName("HelveticaNeue-Light", 12.0f); _slider = new SessionsSlider(new RectangleF(62, 4, UIScreen.MainScreen.Bounds.Width - 120 - 14, 36)); _slider.MinValue = -6; _slider.MaxValue = 6; _slider.Value = 0; _slider.SetThumbImage(UIImage.FromBundle("Images/Sliders/thumb"), UIControlState.Normal); _slider.SetMinTrackImage(UIImage.FromBundle("Images/Sliders/slider2").CreateResizableImage(new UIEdgeInsets(0, 8, 0, 8), UIImageResizingMode.Tile), UIControlState.Normal); _slider.SetMaxTrackImage(UIImage.FromBundle("Images/Sliders/slider").CreateResizableImage(new UIEdgeInsets(0, 8, 0, 8), UIImageResizingMode.Tile), UIControlState.Normal); _slider.ValueChanged += HandleSliderValueChanged; AddSubview(_lblFrequency); AddSubview(_lblValue); AddSubview(_slider); }
private void SetupUserInterface () { BackgroundColor = UIColor.Clear.FromHexString ("#094074", 1.0f); partNameLabel = new UILabel { Font = UIFont.FromName ("SegoeUI-Light", 32f), Frame = new CGRect (0, 0, this.Bounds.Width, 40), Text = "Choose a part.", TextAlignment = UITextAlignment.Center, TextColor = UIColor.White }; partNameButton = new PickerButton { Frame = new CGRect (40, Frame.Height*1/8 + 10, this.Bounds.Width - 80, 30) }; partNameButton.SetTitleColor (UIColor.Clear.FromHexString("#9B9B9B", 1.0f), UIControlState.Normal); searchButton = new SearchButton { Frame = new CGRect (40, Frame.Height*1/5 + 40, this.Bounds.Width - 80, 30) }; searchButton.SetTitle ("Search", UIControlState.Normal); searchButton.SetTitleColor (UIColor.White, UIControlState.Normal); partNamePicker = new UIPickerView { Frame = new CGRect (0, Frame.Height*1/8, this.Bounds.Width, 40), Hidden = true, }; buttonClickable = false; Add (partNameLabel); Add (partNameButton); Add (partNamePicker); Add (searchButton); }
public LoadMoreElement (string normalCaption, string loadingCaption, Action<LoadMoreElement> tapped, UIFont font, UIColor textColor) : base ("") { this.NormalCaption = normalCaption; this.LoadingCaption = loadingCaption; this.tapped = tapped; this.font = font; cell = new UITableViewCell (UITableViewCellStyle.Default, "loadMoreElement"); activityIndicator = new UIActivityIndicatorView () { ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.Gray, Hidden = true }; activityIndicator.StopAnimating (); caption = new UILabel () { Font = font, Text = this.NormalCaption, TextColor = textColor, BackgroundColor = UIColor.Clear, TextAlignment = UITextAlignment.Center, AdjustsFontSizeToFitWidth = false, }; Layout (); cell.ContentView.AddSubview (caption); cell.ContentView.AddSubview (activityIndicator); }
protected override bool OnDrawProperties() { mLabel = mWidget as UILabel; ComponentSelector.Draw<UIFont>(mLabel.font, OnSelectFont); if (mLabel.font == null) return false; string text = EditorGUILayout.TextArea(mLabel.text, GUILayout.Height(100f)); if (!text.Equals(mLabel.text)) { RegisterUndo(); mLabel.text = text; } GUILayout.BeginHorizontal(); { float len = EditorGUILayout.FloatField("Line Width", mLabel.lineWidth, GUILayout.Width(120f)); if (len != mLabel.lineWidth) { RegisterUndo(); mLabel.lineWidth = len; } bool multi = EditorGUILayout.Toggle("Multi-line", mLabel.multiLine, GUILayout.Width(100f)); if (multi != mLabel.multiLine) { RegisterUndo(); mLabel.multiLine = multi; } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { bool password = EditorGUILayout.Toggle("Password", mLabel.password, GUILayout.Width(120f)); if (password != mLabel.password) { RegisterUndo(); mLabel.password = password; } bool encoding = EditorGUILayout.Toggle("Encoding", mLabel.supportEncoding, GUILayout.Width(100f)); if (encoding != mLabel.supportEncoding) { RegisterUndo(); mLabel.supportEncoding = encoding; } } GUILayout.EndHorizontal(); return true; }
void ReleaseDesignerOutlets () { if (btnPlayAudio != null) { btnPlayAudio.Dispose (); btnPlayAudio = null; } if (conDescriptionHeight != null) { conDescriptionHeight.Dispose (); conDescriptionHeight = null; } if (conPlayAudioHeight != null) { conPlayAudioHeight.Dispose (); conPlayAudioHeight = null; } if (imgIncidentImage != null) { imgIncidentImage.Dispose (); imgIncidentImage = null; } if (lblDescription != null) { lblDescription.Dispose (); lblDescription = null; } if (lblOwner != null) { lblOwner.Dispose (); lblOwner = null; } if (lblSubject != null) { lblSubject.Dispose (); lblSubject = null; } }
private void Awake() { _instance = this; _label = GetComponentInChildren<UILabel>(); Hide(); }
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { // check is it 64bit or 32bit Console.WriteLine (IntPtr.Size); // Main app do nothing // Go to Photo > Edit then choose PhotoFilter to start app extension window = new UIWindow (UIScreen.MainScreen.Bounds); window.BackgroundColor = UIColor.White; note = new UILabel (); note.Text = "Note that the app in this sample only serves as a host for the extension. To use the sample extension, edit a photo or video using the Photos app, and tap the extension icon"; note.Lines = 0; note.LineBreakMode = UILineBreakMode.WordWrap; var frame = note.Frame; note.Frame = new CGRect (0, 0, UIScreen.MainScreen.Bounds.Width * 0.75f, 0); note.SizeToFit (); window.AddSubview (note); note.Center = window.Center; window.MakeKeyAndVisible (); return true; }
void Update () { if (mLabel == null) { mLabel = GetComponent<UILabel>(); mLabel.supportEncoding = false; mLabel.symbolStyle = NGUIText.SymbolStyle.None; mText = mLabel.processedText; } if (mOffset < mText.Length) { if (mNextChar <= RealTime.time) { charsPerSecond = Mathf.Max(1, charsPerSecond); // Periods and end-of-line characters should pause for a longer time. float delay = 1f / charsPerSecond; char c = mText[mOffset]; if (c == '.' || c == '\n' || c == '!' || c == '?') delay *= 4f; mNextChar = RealTime.time + delay; mLabel.text = mText.Substring(0, ++mOffset); } } else Destroy(this); }
void ReleaseDesignerOutlets () { if (Login != null) { Login.Dispose (); Login = null; } }
const int buttonSpace = 45; //24; public SessionCell (UITableViewCellStyle style, NSString ident, Session showSession, string big, string small) : base (style, ident) { SelectionStyle = UITableViewCellSelectionStyle.Blue; titleLabel = new UILabel () { TextAlignment = UITextAlignment.Left, BackgroundColor = UIColor.FromWhiteAlpha (0f, 0f) }; speakerLabel = new UILabel () { TextAlignment = UITextAlignment.Left, Font = smallFont, TextColor = UIColor.DarkGray, BackgroundColor = UIColor.FromWhiteAlpha (0f, 0f) }; locationImageView = new UIImageView(); locationImageView.Image = building; button = UIButton.FromType (UIButtonType.Custom); button.TouchDown += delegate { UpdateImage (ToggleFavorite ()); if (AppDelegate.IsPad) { NSObject o = new NSObject(); NSDictionary progInfo = NSDictionary.FromObjectAndKey(o, new NSString("FavUpdate")); NSNotificationCenter.DefaultCenter.PostNotificationName( "NotificationFavoriteUpdated", o, progInfo); } }; UpdateCell (showSession, big, small); ContentView.Add (titleLabel); ContentView.Add (speakerLabel); ContentView.Add (button); ContentView.Add (locationImageView); }
public MilestoneView() : base(new CGRect(0, 0, 320f, 80)) { AutosizesSubviews = true; _titleLabel = new UILabel(); _titleLabel.Frame = new CGRect(10f, 10, Frame.Width - 20f, 18f); _titleLabel.Font = UIFont.BoldSystemFontOfSize(16f); _titleLabel.AutoresizingMask = UIViewAutoresizing.FlexibleWidth; Add(_titleLabel); _openClosedLabel = new UILabel(); _openClosedLabel.Frame = new CGRect(10f, _titleLabel.Frame.Bottom + 1f, 150f, 12f); _openClosedLabel.AutoresizingMask = UIViewAutoresizing.FlexibleRightMargin; _openClosedLabel.Font = UIFont.SystemFontOfSize(11f); Add(_openClosedLabel); _dueLabel = new UILabel(); _dueLabel.Frame = new CGRect(Frame.Width - 150f, _titleLabel.Frame.Bottom + 1f, 150f - 10f, 12f); _dueLabel.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin; _dueLabel.TextAlignment = UITextAlignment.Right; _dueLabel.TextColor = UIColor.DarkGray; _dueLabel.Font = UIFont.SystemFontOfSize(11f); Add(_dueLabel); _progressView = new ProgressBarView(); _progressView.Frame = new CGRect(10f, _openClosedLabel.Frame.Bottom + 9f, Frame.Width - 20f, 20f); _progressView.Layer.MasksToBounds = true; _progressView.Layer.CornerRadius = 4f; _progressView.BackgroundColor = UIColor.Gray; _progressView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth; Add(_progressView); }
public override void ViewDidLoad() { base.ViewDidLoad (); // Setup Background image var imgView = new UIImageView (UIImage.FromBundle ("background")) { ContentMode = UIViewContentMode.ScaleToFill, AutoresizingMask = UIViewAutoresizing.All, Frame = View.Bounds }; View.AddSubview (imgView); // Setup iCarousel view Carousel = new iCarousel (View.Bounds) { CarouselType = iCarouselType.CoverFlow2, DataSource = new ControlsDataSource (this) }; View.AddSubview (Carousel); // Setup info label Label = new UILabel (new RectangleF (20, 362, 280, 21)) { BackgroundColor = UIColor.Clear, Text = string.Empty, TextAlignment = UITextAlignment.Center }; View.AddSubview (Label); }
public override void ViewDidLoad () { base.ViewDidLoad (); //UI setup from code View.BackgroundColor = Theme.BackgroundColor; photoSheet = new PhotoAlertSheet(); photoSheet.DesiredSize = photoSize; photoSheet.Callback = image => { photoViewModel.SelectedPhoto.Image = image.ToByteArray (); var addPhotoController = Storyboard.InstantiateViewController<AddPhotoController>(); addPhotoController.Dismissed += (sender, e) => ReloadConfirmation (); PresentViewController(addPhotoController, true, null); }; addPhoto.SetBackgroundImage (Theme.ButtonDark, UIControlState.Normal); addPhoto.SetTitleColor (UIColor.White, UIControlState.Normal); //Setup our toolbar var label = new UILabel (new RectangleF (0, 0, 120, 36)) { Text = "Confirmations", TextColor = UIColor.White, BackgroundColor = UIColor.Clear, Font = Theme.BoldFontOfSize (16), }; var descriptionButton = new UIBarButtonItem (label); toolbar.Items = new UIBarButtonItem[] { descriptionButton }; photoTableView.Source = new PhotoTableSource (this); signatureTableView.Source = new SignatureTableSource (this); }
private void CreateObjects() { Transform transform = base.transform.Find("personInfoLayer"); this.mNameLabel = transform.Find("name").GetComponent<UILabel>(); this.mGuildNameLabel = transform.Find("guildName").GetComponent<UILabel>(); Transform transform2 = transform.Find("bg"); this.mIcon = transform2.Find("icon").GetComponent<UISprite>(); this.mQualityMask = transform2.Find("Frame").GetComponent<UISprite>(); GameObject gameObject = transform.Find("closeBtn").gameObject; UIEventListener expr_8C = UIEventListener.Get(gameObject); expr_8C.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_8C.onClick, new UIEventListener.VoidDelegate(this.OnCloseBtnClick)); GameObject gameObject2 = transform.Find("chatBtn").gameObject; UIEventListener expr_C4 = UIEventListener.Get(gameObject2); expr_C4.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_C4.onClick, new UIEventListener.VoidDelegate(this.OnChatClick)); GameObject gameObject3 = transform.Find("viewBtn").gameObject; UIEventListener expr_FE = UIEventListener.Get(gameObject3); expr_FE.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_FE.onClick, new UIEventListener.VoidDelegate(this.OnViewClick)); GameObject gameObject4 = transform.Find("friendBtn").gameObject; UIEventListener expr_138 = UIEventListener.Get(gameObject4); expr_138.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_138.onClick, new UIEventListener.VoidDelegate(this.OnFriendClick)); this.mFriendLabel = gameObject4.transform.Find("Label").GetComponent<UILabel>(); GameObject gameObject5 = transform.Find("backlistBtn").gameObject; UIEventListener expr_18E = UIEventListener.Get(gameObject5); expr_18E.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_18E.onClick, new UIEventListener.VoidDelegate(this.OnBacklistClick)); this.mBacklistLabel = gameObject5.transform.Find("Label").GetComponent<UILabel>(); }
void ReleaseDesignerOutlets () { if (Label != null) { Label.Dispose (); Label = null; } }
public void buildReport() { Root = new RootElement (""); var v = new UIView (); v.Frame = new RectangleF (10, 10, 600, 10); var dummy = new Section (v); Root.Add (dummy); var headerLabel = new UILabel (new RectangleF (10, 10, 800, 48)) { Font = UIFont.BoldSystemFontOfSize (18), BackgroundColor = ColorHelper.GetGPPurple (), TextAlignment = UITextAlignment.Center, TextColor = UIColor.White, Text = "Branch Matter Analysis" }; var view = new UIViewBordered (); view.Frame = new RectangleF (10, 20, 800, 48); view.Add (headerLabel); Root.Add (new Section (view)); // for (int i = 0; i < report.branches.Count; i++) { Branch branch = report.branches [i]; Section s = new Section (branch.name + " Branch Totals"); Root.Add (s); // if (branch.branchTotals.matterActivity != null) { var matterActivitySection = new Section (); var mTitle = new TitleElement ("Matter Activity"); matterActivitySection.Add (mTitle); matterActivitySection.Add (new NumberElement (branch.branchTotals.matterActivity.active, "Active Matters: ")); matterActivitySection.Add (new NumberElement ( branch.branchTotals.matterActivity.deactivated, "Deactivated Matters: " )); matterActivitySection.Add (new NumberElement (branch.branchTotals.matterActivity.newWork, "New Work: ")); matterActivitySection.Add (new NumberElement (branch.branchTotals.matterActivity.workedOn, "Worked On: ")); matterActivitySection.Add (new NumberElement (branch.branchTotals.matterActivity.noActivity, "No Activity: ")); matterActivitySection.Add (new StringElement ("No Activity Duration: " + branch.branchTotals.matterActivity.noActivityDuration)); Root.Add (matterActivitySection); } // if (branch.branchTotals.matterBalances != null) { var matterBalancesSection = new Section (); var mTitle = new TitleElement ("Matter Balances"); matterBalancesSection.Add (mTitle); matterBalancesSection.Add (getElement (branch.branchTotals.matterBalances.business, S.GetText (S.BUSINESS) + ": ")); matterBalancesSection.Add (getElement (branch.branchTotals.matterBalances.trust, S.GetText (S.TRUST_BALANCE) + ": ")); matterBalancesSection.Add (getElement (branch.branchTotals.matterBalances.investment, S.GetText (S.INVESTMENTS) + ": ")); matterBalancesSection.Add (getElement (branch.branchTotals.matterBalances.unbilled, "Unbilled: ")); matterBalancesSection.Add (getElement (branch.branchTotals.matterBalances.pendingDisbursements, "Pending Disb.: ")); Root.Add (matterBalancesSection); } } for (var i = 0; i < 10; i++) { Root.Add (new Section (" ")); } }
public override void Init() { base.Init(); percentLabel = FindComponent<UILabel>("percent"); detailLabel = FindComponent<UILabel>("detail"); }
/// <summary> /// this is where we do the meat of creating our alert, which includes adding /// controls, etc. /// </summary> public override void Draw(RectangleF rect) { // if the control hasn't been setup yet if (activityIndicator == null) { // if we have a message if (!string.IsNullOrEmpty (message)) { lblMessage = new UILabel (new RectangleF (20, 10, rect.Width - 40, 33)); lblMessage.BackgroundColor = UIColor.Clear; lblMessage.TextColor = UIColor.LightTextColor; lblMessage.TextAlignment = UITextAlignment.Center; lblMessage.Text = message; this.AddSubview (lblMessage); } // instantiate a new activity indicator activityIndicator = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.White); activityIndicator.Frame = new RectangleF ((rect.Width / 2) - (activityIndicator.Frame.Width / 2) , 50, activityIndicator.Frame.Width, activityIndicator.Frame.Height); this.AddSubview (activityIndicator); activityIndicator.StartAnimating (); } base.Draw (rect); }
void Awake() { m_transform = transform; gameObject.SetActive(false); ClimbTowerUILogicManager.Instance.Initialize(this); m_rewardList = m_transform.FindChild("RightBox/RewardList"); m_towerList = m_transform.FindChild("TowerList"); m_report = m_transform.FindChild("report").gameObject; m_reportList = m_transform.FindChild("report/BattleReportList"); m_rewardTitle = m_transform.FindChild("report/img/lblTitle").GetComponentsInChildren<UILabel>(true)[0]; m_highHistory = m_transform.FindChild("RightBox/historyHigh").GetComponentsInChildren<UILabel>(true)[0]; //m_currentLevel = m_transform.FindChild("RightBox/TriPager/lblCurrentLevel").GetComponentsInChildren<UILabel>(true)[0]; m_leftChallengeCount = m_transform.FindChild("LeftBox/lblContainer/lblChallengeCount").GetComponentsInChildren<UILabel>(true)[0]; m_lblGuide = m_transform.FindChild("LeftBox/lblContainer/lblGuide").GetComponentsInChildren<UILabel>(true)[0]; m_leftVIPSweepCount = m_transform.FindChild("LeftBox/lblContainer/lblVIPSweepCount").GetComponentsInChildren<UILabel>(true)[0]; m_closeAnchor = m_transform.FindChild("closeAnchor").GetComponentsInChildren<UIAnchor>(true)[0]; m_buttonVIP = m_transform.FindChild("RightBox/btnTowerVIP").GetComponentsInChildren<MogoTwoStatusButton>(true)[0]; m_buttonNormal = m_transform.FindChild("RightBox/btnTowerNormal").GetComponentsInChildren<MogoTwoStatusButton>(true)[0]; AddButtonListener("onClicked", "RightBox/btnEnter", ClimbTowerUILogicManager.Instance.OnEnterMap); AddButtonListener("onClicked", "LeftBox/btnTowerCharge", ClimbTowerUILogicManager.Instance.Charge); AddButtonListener("onClicked", "RightBox/btnTowerNormal", ClimbTowerUILogicManager.Instance.NormalSweep); AddButtonListener("onClicked", "RightBox/btnTowerVIP", ClimbTowerUILogicManager.Instance.VIPSweep); AddButtonListener("onClicked", "closeAnchor/btnClose", Close); AddButtonListener("onClicked", "report/img/btnClose", closeReport); if (MogoUIManager.Instance.WaitingWidgetName == "btnEnter") { TimerHeap.AddTimer(100, 0, () => { EventDispatcher.TriggerEvent("WaitingWidgetFinished"); }); } //m_towerList.GetComponent<MogoListImproved>().SetGridLayout<TowerUnit>(7, m_towerList.transform, TowerLoaded); }
public ProgressLabel (string text) : base (new RectangleF (0, 0, 200, 44)) { BackgroundColor = UIColor.Clear; activity = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.White) { Frame = new RectangleF (0, 11.5f, 21, 21), HidesWhenStopped = false, Hidden = false, }; AddSubview (activity); var label = new UILabel () { Text = text, TextColor = UIColor.White, Font = UIFont.BoldSystemFontOfSize (20), BackgroundColor = UIColor.Clear, Frame = new CGRect (25, 0, Frame.Width - 25, 44), }; AddSubview (label); var f = Frame; f.Width = label.Frame.X + label.Text.StringSize (label.Font).Width; Frame = f; }
void Awake() { m_instance = this; m_myTransform = transform; FillFullNameData(m_myTransform); m_goOccupyTowerPassUIPlayer = FindTransform("OccupyTowerPassUIPlayer").gameObject; m_goOccupyTowerPassUIPlayer.SetActive(false); m_listPlayerInfoPos.Clear(); for (int i = 1; i <= MAX_PLAYER_COUNT; i++) { GameObject goPlayerPos = FindTransform(string.Format("OccupyTowerPassUIPlayerPos{0}", i)).gameObject; m_listPlayerInfoPos.Add(goPlayerPos); } AddPlayerInfoList(MAX_PLAYER_COUNT, () => { SetPlayerInfoListData(m_listPlayerInfoData); }); m_spOccupyTowerPassUITitle = FindTransform("OccupyTowerPassUITitle").GetComponentsInChildren<UISprite>(true)[0]; m_lblOccupyTowerPassUICountDown = FindTransform("OccupyTowerPassUICountDown").GetComponentsInChildren<UILabel>(true)[0]; m_goOccupyTowerPassUIResult = FindTransform("OccupyTowerPassUIResult").gameObject; m_lblOccupyTowerPassUIResultText = FindTransform("OccupyTowerPassUIResultText").GetComponentsInChildren<UILabel>(true)[0]; m_goOccupyTowerPassUIReward = FindTransform("OccupyTowerPassUIReward").gameObject; m_lblOccupyTowerPassUIRewardText = FindTransform("OccupyTowerPassUIRewardText").GetComponentsInChildren<UILabel>(true)[0]; m_lblOccupyTowerPassUIPlayerTitleRank = FindTransform("OccupyTowerPassUIPlayerTitleRank").GetComponentsInChildren<UILabel>(true)[0]; m_lblOccupyTowerPassUIPlayerTitleAddition = FindTransform("OccupyTowerPassUIPlayerTitleAddition").GetComponentsInChildren<UILabel>(true)[0]; Initialize(); }
public override void ViewDidLoad() { base.ViewDidLoad(); var view = new UIView { BackgroundColor = UIColor.White }; var label = new UILabel { TranslatesAutoresizingMaskIntoConstraints = false, Text = "No Conversation Selected", TextColor = UIColor.FromWhiteAlpha(0.0f, 0.4f), Font = UIFont.PreferredHeadline }; view.AddSubview(label); view.AddConstraint(NSLayoutConstraint.Create(label, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, view, NSLayoutAttribute.CenterX, 1.0f, 0.0f)); view.AddConstraint(NSLayoutConstraint.Create(label, NSLayoutAttribute.CenterY, NSLayoutRelation.Equal, view, NSLayoutAttribute.CenterY, 1.0f, 0.0f)); View = view; }
public EquipmentListTableItem(string cellId) : base(UITableViewCellStyle.Default, cellId) { Layout = new LinearLayout(Orientation.Vertical) { Padding = new UIEdgeInsets(5, 5, 5, 5), LayoutParameters = new LayoutParameters() { Width = AutoSize.FillParent, Height = AutoSize.WrapContent, }, SubViews = new View[] { new LinearLayout(Orientation.Horizontal) { LayoutParameters = new LayoutParameters() { Width = AutoSize.FillParent, Height = AutoSize.WrapContent, }, SubViews = new View[] { new NativeView() { View = equipmentnum = new UILabel() { Text = "Equipment Number", BackgroundColor = UIColor.Clear, Font = UIFont.BoldSystemFontOfSize(10), HighlightedTextColor = UIColor.White, }, }, new NativeView() { View = equipdescri = new UILabel() { Text = "Equipment Description", BackgroundColor = UIColor.Clear, Font = UIFont.BoldSystemFontOfSize(10), HighlightedTextColor = UIColor.White, }, }, new NativeView() { View = imageview = new UIImageView() { }, }, } }, new NativeView() { View = Euiphrs = new UILabel() { Text = " Equip Hrs 10.0", BackgroundColor = UIColor.Clear, Font = UIFont.BoldSystemFontOfSize(10), TextColor = UIColor.Red, HighlightedTextColor = UIColor.White, }, LayoutParameters = new LayoutParameters() { Width = AutoSize.FillParent, Height = AutoSize.WrapContent, }, }, new LinearLayout(Orientation.Horizontal) { //LayoutParameters = new LayoutParameters() //{ // Width = AutoSize.FillParent, //Height = AutoSize.WrapContent, //}, SubViews = new View[] { //longitu, latitude, shiftstart, shiftend new NativeView() { View = longitu = new UILabel() { Text = " 10.0", BackgroundColor = UIColor.Clear, Font = UIFont.BoldSystemFontOfSize(10), TextColor = UIColor.Red, HighlightedTextColor = UIColor.White, }, LayoutParameters = new LayoutParameters() { Width = AutoSize.FillParent, Height = AutoSize.WrapContent, }, }, new NativeView() { View = latitude = new UILabel() { Text = " 0.0", BackgroundColor = UIColor.Clear, Font = UIFont.SystemFontOfSize(10), TextColor = UIColor.Red, HighlightedTextColor = UIColor.White, }, LayoutParameters = new LayoutParameters() { Width = AutoSize.FillParent, Height = AutoSize.WrapContent, }, }, } } } }; //this.ContentView.Add(new UILayoutHost(Layout, this.ContentView.Bounds)); this.ContentView.AddSubviews(new UIView[] { equipmentnum, equipdescri, imageview, latitude, longitu, Euiphrs }); }
private void Update() { if (this.mLabel == null) { this.mLabel = base.GetComponent <UILabel>(); this.index = 0; this.maxCount = 1; this.wait = false; this.mText = new string[1]; this.mText[this.index] = this.mLabel.processedText; } if (this.mOffset < this.mText[this.index].Length) { if (this.mNextChar <= RealTime.time) { this.charsPerSecond = Mathf.Max(1, this.charsPerSecond); float num = 1f / (float)this.charsPerSecond; char c = this.mText[this.index][this.mOffset]; if (c == '.' || c == '\n' || c == '!' || c == '?') { num *= 4f; } NGUIText.ParseSymbol(this.mText[this.index], ref this.mOffset); this.mNextChar = RealTime.time + num; this.mLabel.text = this.mText[this.index].Substring(0, ++this.mOffset); } } else if (!this.wait) { this.index++; if (this.index >= this.maxCount) { if (this.WriteComplete != null) { this.WriteComplete(); } UnityEngine.Object.Destroy(this); } else { this.mOffset = 0; } } if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1)) { if (this.mOffset < this.mText[this.index].Length) { this.mLabel.text = this.mText[this.index]; this.mOffset = this.mText[this.index].Length; } else { this.index++; if (this.index >= this.maxCount) { if (this.WriteComplete != null) { this.WriteComplete(); } UnityEngine.Object.Destroy(this); } else { this.mOffset = 0; } } } }
/// <summary> /// Show the popup list dialog. /// </summary> public virtual void Show() { if (enabled && NGUITools.GetActive(gameObject) && mChild == null && atlas != null && isValid && items.Count > 0) { mLabelList.Clear(); StopCoroutine("CloseIfUnselected"); // Ensure the popup's source has the selection UICamera.selectedObject = (UICamera.hoveredObject ?? gameObject); mSelection = UICamera.selectedObject; source = UICamera.selectedObject; if (source == null) { Debug.LogError("Popup list needs a source object..."); return; } mOpenFrame = Time.frameCount; // Automatically locate the panel responsible for this object if (mPanel == null) { mPanel = UIPanel.Find(transform); if (mPanel == null) { return; } } // Calculate the dimensions of the object triggering the popup list so we can position it below it Vector3 min; Vector3 max; // Create the root object for the list mChild = new GameObject("Drop-down List"); mChild.layer = gameObject.layer; if (separatePanel) { if (GetComponent <Collider>() != null) { Rigidbody rb = mChild.AddComponent <Rigidbody>(); rb.isKinematic = true; } else if (GetComponent <Collider2D>() != null) { Rigidbody2D rb = mChild.AddComponent <Rigidbody2D>(); rb.isKinematic = true; } mChild.AddComponent <UIPanel>().depth = 1000000; } current = this; Transform t = mChild.transform; t.parent = mPanel.cachedTransform; Vector3 pos; // Manually triggered popup list on some other game object if (openOn == OpenOn.Manual && mSelection != gameObject) { pos = UICamera.lastEventPosition; min = mPanel.cachedTransform.InverseTransformPoint(mPanel.anchorCamera.ScreenToWorldPoint(pos)); max = min; t.localPosition = min; pos = t.position; } else { Bounds bounds = NGUIMath.CalculateRelativeWidgetBounds(mPanel.cachedTransform, transform, false, false); min = bounds.min; max = bounds.max; t.localPosition = min; pos = t.position; } StartCoroutine("CloseIfUnselected"); //t.localRotation = Quaternion.identity; t.eulerAngles = gameObject.transform.eulerAngles; t.localScale = Vector3.one; // Add a sprite for the background mBackground = NGUITools.AddSprite(mChild, atlas, backgroundSprite, separatePanel ? 0 : NGUITools.CalculateNextDepth(mPanel.gameObject)); mBackground.pivot = UIWidget.Pivot.TopLeft; mBackground.color = backgroundColor; // We need to know the size of the background sprite for padding purposes Vector4 bgPadding = mBackground.border; mBgBorder = bgPadding.y; mBackground.cachedTransform.localPosition = new Vector3(0f, bgPadding.y, 0f); // Add a sprite used for the selection mHighlight = NGUITools.AddSprite(mChild, atlas, highlightSprite, mBackground.depth + 1); mHighlight.pivot = UIWidget.Pivot.TopLeft; mHighlight.color = highlightColor; UISpriteData hlsp = mHighlight.GetAtlasSprite(); if (hlsp == null) { return; } float hlspHeight = hlsp.borderTop; float fontHeight = activeFontSize; float dynScale = activeFontScale; float labelHeight = fontHeight * dynScale; float x = 0f, y = -padding.y; List <UILabel> labels = new List <UILabel>(); // Clear the selection if it's no longer present if (!items.Contains(mSelectedItem)) { mSelectedItem = null; } // Run through all items and create labels for each one for (int i = 0, imax = items.Count; i < imax; ++i) { string s = items[i]; UILabel lbl = NGUITools.AddWidget <UILabel>(mChild, mBackground.depth + 2); lbl.name = i.ToString(); lbl.pivot = UIWidget.Pivot.TopLeft; lbl.bitmapFont = bitmapFont; lbl.trueTypeFont = trueTypeFont; lbl.fontSize = fontSize; lbl.fontStyle = fontStyle; lbl.text = isLocalized ? Localization.Get(s) : s; lbl.color = textColor; lbl.cachedTransform.localPosition = new Vector3(bgPadding.x + padding.x - lbl.pivotOffset.x, y, -1f); lbl.overflowMethod = UILabel.Overflow.ResizeFreely; lbl.alignment = alignment; labels.Add(lbl); y -= labelHeight; y -= padding.y; x = Mathf.Max(x, lbl.printedSize.x); // Add an event listener UIEventListener listener = UIEventListener.Get(lbl.gameObject); listener.onHover = OnItemHover; listener.onPress = OnItemPress; listener.onScroll = OnItemScroll; listener.parameter = s; // Move the selection here if this is the right label if (mSelectedItem == s || (i == 0 && string.IsNullOrEmpty(mSelectedItem))) { Highlight(lbl, true); } // Add this label to the list mLabelList.Add(lbl); } // The triggering widget's width should be the minimum allowed width x = Mathf.Max(x, (max.x - min.x) - (bgPadding.x + padding.x) * 2f); float cx = x; Vector3 bcCenter = new Vector3(cx * 0.5f, -labelHeight * 0.5f, 0f); Vector3 bcSize = new Vector3(cx, (labelHeight + padding.y), 1f); // Run through all labels and add colliders for (int i = 0, imax = labels.Count; i < imax; ++i) { UILabel lbl = labels[i]; NGUITools.AddWidgetCollider(lbl.gameObject); lbl.autoResizeBoxCollider = false; BoxCollider bc = lbl.GetComponent <BoxCollider>(); if (bc != null) { bcCenter.z = bc.center.z; bc.center = bcCenter; bc.size = bcSize; } else { BoxCollider2D b2d = lbl.GetComponent <BoxCollider2D>(); #if UNITY_4_3 || UNITY_4_5 || UNITY_4_6 b2d.center = bcCenter; #else b2d.offset = bcCenter; #endif b2d.size = bcSize; } } int lblWidth = Mathf.RoundToInt(x); x += (bgPadding.x + padding.x) * 2f; y -= bgPadding.y; // Scale the background sprite to envelop the entire set of items mBackground.width = Mathf.RoundToInt(x); mBackground.height = Mathf.RoundToInt(-y + bgPadding.y); // Set the label width to make alignment work for (int i = 0, imax = labels.Count; i < imax; ++i) { UILabel lbl = labels[i]; lbl.overflowMethod = UILabel.Overflow.ShrinkContent; lbl.width = lblWidth; } // Scale the highlight sprite to envelop a single item float scaleFactor = 2f * atlas.pixelSize; float w = x - (bgPadding.x + padding.x) * 2f + hlsp.borderLeft * scaleFactor; float h = labelHeight + hlspHeight * scaleFactor; mHighlight.width = Mathf.RoundToInt(w); mHighlight.height = Mathf.RoundToInt(h); bool placeAbove = (position == Position.Above); if (position == Position.Auto) { UICamera cam = UICamera.FindCameraForLayer(mSelection.layer); if (cam != null) { Vector3 viewPos = cam.cachedCamera.WorldToViewportPoint(pos); placeAbove = (viewPos.y < 0.5f); } } // If the list should be animated, let's animate it by expanding it if (isAnimated) { AnimateColor(mBackground); if (Time.timeScale == 0f || Time.timeScale >= 0.1f) { float bottom = y + labelHeight; Animate(mHighlight, placeAbove, bottom); for (int i = 0, imax = labels.Count; i < imax; ++i) { Animate(labels[i], placeAbove, bottom); } AnimateScale(mBackground, placeAbove, bottom); } } // If we need to place the popup list above the item, we need to reposition everything by the size of the list if (placeAbove) { min.y = max.y - bgPadding.y; max.y = min.y + mBackground.height; max.x = min.x + mBackground.width; t.localPosition = new Vector3(min.x, max.y - bgPadding.y, min.z); } else { max.y = min.y + bgPadding.y; min.y = max.y - mBackground.height; max.x = min.x + mBackground.width; } Transform pt = mPanel.cachedTransform.parent; if (pt != null) { min = mPanel.cachedTransform.TransformPoint(min); max = mPanel.cachedTransform.TransformPoint(max); min = pt.InverseTransformPoint(min); max = pt.InverseTransformPoint(max); } // Ensure that everything fits into the panel's visible range Vector3 offset = mPanel.hasClipping ? Vector3.zero : mPanel.CalculateConstrainOffset(min, max); pos = t.localPosition + offset; pos.x = Mathf.Round(pos.x); pos.y = Mathf.Round(pos.y); t.localPosition = pos; } else { OnSelect(false); } if (mChild != null) { //if (gameObject.layer == Program.ui_back_ground_2d.layer) //{ // mChild.transform.SetParent(Program.ui_main_2d.transform, true); // var trans = mChild.GetComponentsInChildren<Transform>(); // foreach (var item in trans) // { // item.gameObject.layer = Program.ui_main_2d.layer; // } //} if (gameObject.layer == Program.ui_main_3d.layer) { mChild.transform.SetParent(Program.ui_main_3d.transform, true); } if (gameObject.layer == Program.ui_windows_2d.layer) { mChild.transform.SetParent(Program.ui_windows_2d.transform, true); } if (gameObject.layer == Program.ui_main_2d.layer) { mChild.transform.SetParent(Program.ui_main_2d.transform, true); } } }
protected virtual void SetupTitle(UILabel title) { title.SetupStyle(ThemeConfig.HistoryOrderItemCell.Title); }
public override void LayoutSubviews() { base.LayoutSubviews(); CustomCollectionView.Frame = new CGRect(0, 70, Frame.Width, Frame.Height - 150); CustomCollectionView.DataSource = ViewModel.ModelCollection; CustomCollectionView.ItemSelected += (sender, e) => { var model = e as SerializationModel; ValidateItem(model); }; CustomCollectionView.LongPressed += (sender, e) => { if ((e as SerializationModel).Name != "Create New") { deleteIcon.Alpha = 1; EnableSelection(); } }; this.BackgroundColor = UIColor.FromRGB(242, 242, 242); /*------Header Label-------*/ UILabel label = new UILabel(new CGRect(20, 50, Frame.Width, 25)); label.BackgroundColor = UIColor.Clear; label.Font = UIFont.SystemFontOfSize(25); label.TextAlignment = UITextAlignment.Left; label.TextColor = UIColor.Gray; label.Text = "Serialization"; /*------Delete------------*/ deleteIcon = new UIButton(new CGRect(Frame.Width / 2 - 50, Frame.Height - 60, 100, 50)); deleteIcon.Alpha = 0; deleteIcon.BackgroundColor = UIColor.Clear; deleteIcon.TouchUpInside += (sender, e) => { for (int i = 0; i < list.Count; i++) { if (ViewModel.ModelCollection.Contains(list[i])) { ViewModel.ModelCollection.Remove(list[i]); } } foreach (var item1 in ViewModel.ModelCollection) { item1.IsImageSelected = false; item1.IsItemSelectedToDelete = false; list = new List <SerializationModel>(); } CustomCollectionView.DataSource = ViewModel.ModelCollection; deleteIcon.Alpha = 0; }; UIImageView DeleteButton = new UIImageView(new CGRect(0, 0, 100, 50)); DeleteButton.Image = UIImage.FromBundle("Images/ImageEditor/Delete1.png"); DeleteButton.ContentMode = UIViewContentMode.ScaleAspectFit; deleteIcon.AddSubview(DeleteButton); AddSubview(label); AddSubview(CustomCollectionView); AddSubview(deleteIcon); }
void getPropertiesInitialization() { navigationModePicker = new UIPickerView(); navigationDirectionPicker = new UIPickerView(); tabStripPicker = new UIPickerView(); PickerModel navigationModeModel = new PickerModel(navigationModeList); navigationModePicker.Model = navigationModeModel; PickerModel navigationDirectionModel = new PickerModel(navigationDirectionList); navigationDirectionPicker.Model = navigationDirectionModel; PickerModel tabStripModel = new PickerModel(tabStripPositionList); tabStripPicker.Model = tabStripModel; //navigationModeLabel navigationModeLabel = new UILabel(); navigationModeLabel.Text = "NavigationStrip Mode"; navigationModeLabel.TextColor = UIColor.Black; navigationModeLabel.TextAlignment = UITextAlignment.Left; navigationDirectionLabel = new UILabel(); navigationDirectionLabel.Text = "Navigation Direction"; navigationDirectionLabel.TextColor = UIColor.Black; navigationDirectionLabel.TextAlignment = UITextAlignment.Left; tabStripLabel = new UILabel(); tabStripLabel.Text = "NavigationStrip Position"; tabStripLabel.TextColor = UIColor.Black; tabStripLabel.TextAlignment = UITextAlignment.Left; //navigationModeButton navigationModeButton = new UIButton(); navigationModeButton.SetTitle("Dots", UIControlState.Normal); navigationModeButton.SetTitleColor(UIColor.Black, UIControlState.Normal); navigationModeButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center; navigationModeButton.Layer.CornerRadius = 8; navigationModeButton.Layer.BorderWidth = 2; navigationModeButton.TouchUpInside += ShownavigationModePicker; navigationModeButton.Layer.BorderColor = UIColor.FromRGB(246, 246, 246).CGColor; //navigationDirectionButton navigationDirectionButton = new UIButton(); navigationDirectionButton.SetTitle("Horizontal", UIControlState.Normal); navigationDirectionButton.SetTitleColor(UIColor.Black, UIControlState.Normal); navigationDirectionButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center; navigationDirectionButton.Layer.CornerRadius = 8; navigationDirectionButton.Layer.BorderWidth = 2; navigationDirectionButton.TouchUpInside += ShownavigationDirectionPicker; navigationDirectionButton.Layer.BorderColor = UIColor.FromRGB(246, 246, 246).CGColor; //tabStripButton tabStripButton = new UIButton(); tabStripButton.SetTitle("Bottom", UIControlState.Normal); tabStripButton.SetTitleColor(UIColor.Black, UIControlState.Normal); tabStripButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center; tabStripButton.Layer.CornerRadius = 8; tabStripButton.Layer.BorderWidth = 2; tabStripButton.TouchUpInside += ShowtabStripPicker; tabStripButton.Layer.BorderColor = UIColor.FromRGB(246, 246, 246).CGColor; doneButton = new UIButton(); doneButton.SetTitle("Done\t", UIControlState.Normal); doneButton.SetTitleColor(UIColor.Black, UIControlState.Normal); doneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Right; doneButton.TouchUpInside += HidePicker; doneButton.Hidden = true; doneButton.BackgroundColor = UIColor.FromRGB(246, 246, 246); navigationModeModel.PickerChanged += navigationModeSelectedIndexChanged; navigationDirectionModel.PickerChanged += navigationDirectionSelectedIndexChanged; tabStripModel.PickerChanged += tabStripSelectedIndexChanged; navigationModePicker.ShowSelectionIndicator = true; navigationModePicker.Hidden = true; navigationModePicker.BackgroundColor = UIColor.Gray; navigationDirectionPicker.BackgroundColor = UIColor.Gray; navigationDirectionPicker.ShowSelectionIndicator = true; navigationDirectionPicker.Hidden = true; tabStripPicker.BackgroundColor = UIColor.Gray; tabStripPicker.ShowSelectionIndicator = true; tabStripPicker.Hidden = true; //autoPlayLabel autoPlayLabel = new UILabel(); autoPlayLabel.TextColor = UIColor.Black; autoPlayLabel.BackgroundColor = UIColor.Clear; autoPlayLabel.Text = @"Enable AutoPlay"; autoPlayLabel.TextAlignment = UITextAlignment.Left; autoPlayLabel.Font = UIFont.FromName("Helvetica", 16f); //allowSwitch autoPlaySwitch = new UISwitch(); autoPlaySwitch.ValueChanged += autoPlayToggleChanged; autoPlaySwitch.On = false; //adding to mainview main_view = new UIView(); main_view.AddSubview(rotator); main_view.AddSubview(doneButton); main_view.AddSubview(navigationDirectionPicker); main_view.AddSubview(navigationModePicker); main_view.AddSubview(tabStripPicker); sub_View = new UIScrollView(); sub_View.AddSubview(navigationModeLabel); sub_View.AddSubview(navigationModeButton); sub_View.AddSubview(navigationDirectionLabel); sub_View.AddSubview(navigationDirectionButton); sub_View.AddSubview(tabStripLabel); sub_View.AddSubview(tabStripButton); sub_View.AddSubview(autoPlayLabel); sub_View.AddSubview(autoPlaySwitch); main_view.AddSubview(sub_View); }
public void ShowEquipTip (string suitName, List <string> suitAttr, List <string> attrs, List <string> jewels, List <string> slotIcons, List <ButtonInfo> buttonList, FumoTipUIInfo fumoInfo = null) { if (this.gameObject.activeSelf && !m_equipTipCurrent.activeSelf) { ReleaseInstance(); } //Debug.LogError("ShowEquipTip"); EventDispatcher.TriggerEvent(SettingEvent.UIUpPlaySound, "ItemTip"); float attrGap = 10; float gap = -12; Transform root = transform.FindChild(m_widgetToFullName["EquipTipDetailList"]); //加载+排版 int i = 0; //属性 //添加套装名 if (suitName != "") { var _gap = gap; GetInstance("EquipTipSuitNameTitle.prefab", (gameObject) => { GameObject go = gameObject as GameObject; UILabel lable = go.transform.FindChild("EquipTipSuitName").GetComponent <UILabel>(); Vector3 scale = go.transform.localScale; Vector3 position = go.transform.localPosition; Vector3 angle = go.transform.localEulerAngles; go.transform.parent = root; go.transform.localScale = scale; go.transform.localEulerAngles = angle; go.transform.localPosition = new Vector3(0, _gap, 0); gos.Add(go); lable.text = suitName; } ); gap -= GAP + 22; //Debug.LogError(gap); } //添加套装属性 if (suitAttr != null) { for (i = 0; i < suitAttr.Count; i++) { var index = i; var _gap = gap; GetInstance("EquipTipSuitAttr.prefab", (gameObject) => { //PackageEquipInfoDiamonHole0Text GameObject go = gameObject as GameObject; UILabel lable = go.transform.GetComponent <UILabel>(); Utils.MountToSomeObjWithoutPosChange(go.transform, root); //Vector3 scale = go.transform.localScale; Vector3 position = go.transform.localPosition; //Vector3 angle = go.transform.localEulerAngles; //go.transform.parent = root; //go.transform.localScale = scale; //go.transform.localEulerAngles = angle; go.transform.localPosition = new Vector3(position.x, _gap - index * (attrGap + 22), 0); gos.Add(go); lable.text = suitAttr[index]; } ); } if (suitAttr.Count > 0) { gap -= GAP + (i * attrGap + 22); } //Debug.LogError(gap); } //Debug.LogError(gap); for (i = 0; i < attrs.Count; i++) { var index = i; var _gap = gap; GetInstance("PackageEquipInfoAttr.prefab", (gameObject) => { //PackageEquipInfoDiamonHole0Text GameObject go = gameObject as GameObject; UILabel lable = go.transform.FindChild("PackageEquipInfoDiamonHole0Text").GetComponent <UILabel>(); Vector3 scale = go.transform.localScale; Vector3 position = go.transform.localPosition; Vector3 angle = go.transform.localEulerAngles; go.transform.parent = root; go.transform.localScale = scale; go.transform.localEulerAngles = angle; go.transform.localPosition = new Vector3(0, _gap - index * (attrGap + 22), 0); gos.Add(go); lable.text = attrs[index]; } ); } gap -= GAP + i * (attrGap + 22); // 附魔 if (fumoInfo != null) { var _gap = gap; //标题 GetInstance(FumoTitle, (gameObject) => { //PackageEquipInfoDiamonHole0Text GameObject go = gameObject as GameObject; UILabel lable = go.transform.FindChild("PackageEquipInfoEnhantTitleText").GetComponent <UILabel>(); lable.text = fumoInfo.fumoTitle; Utils.MountToSomeObjWithoutPosChange(go.transform, root); go.transform.localPosition = new Vector3(0, _gap, 0); gos.Add(go); } ); gap -= GAP + 22; var _gap2 = gap; for (i = 0; i < fumoInfo.fomoDesp.Count; i++) { int index = i; GetInstance(FumoAttr, (gameObject) => { //PackageEquipInfoDiamonHole0Text GameObject go = gameObject as GameObject; UILabel lable = go.transform.FindChild("PackageEquipInfoEnhantText").GetComponent <UILabel>(); lable.text = fumoInfo.fomoDesp[index]; Utils.MountToSomeObjWithoutPosChange(go.transform, root); go.transform.localPosition = new Vector3(0, _gap2 - index * (attrGap + 22), 0); gos.Add(go); } ); } gap -= GAP + i * (attrGap + 22); } //宝石 for (i = 0; i < jewels.Count; i++) { float _gap = gap; var index = i; GetInstance("PackageEquipInfoDiamon.prefab", (gameObject) => { //PackageEquipInfoDiamonHole0Text GameObject go = gameObject as GameObject; UILabel lable = go.transform.FindChild("PackageEquipInfoDiamonHole12Text").GetComponent <UILabel>(); UISprite sprite = go.transform.FindChild("PackageEquipInfoDiamonHole12FG").GetComponent <UISprite>(); Vector3 scale = go.transform.localScale; Vector3 position = go.transform.localPosition; Vector3 angle = go.transform.localEulerAngles; go.transform.parent = root; go.transform.localScale = scale; go.transform.localEulerAngles = angle; go.transform.localPosition = new Vector3(0, _gap - index * (attrGap + 22), 0); gos.Add(go); lable.text = jewels[index]; //if (lable.text.Equals(LanguageData.GetContent(910))) //{ sprite.spriteName = slotIcons[index]; //} } ); } gap -= GAP + i * (attrGap + 22); //需求等级等 Transform detail3 = transform.FindChild(m_widgetToFullName["EquipTipDetail3"]); detail3.gameObject.SetActive(true); detail3.localPosition = new Vector3(0, gap, 0); //m_equipDetailNeedJob.GetComponent<UILabel>().text = LanguageData.GetContent(912, vocation); gap -= 56; //m_equipTipCamera.height = gap - 400; //m_equipTipCamera.Reset(); //show float minY; minY = -gap + 3 - m_equipTipCameraArea.localScale.y;//; //Debug.LogError("m_equipTipCamera.camera.pixelRect.height:" + m_equipTipCamera.camera.pixelRect.height); //Debug.LogError("m_equipTipCameraArea.localScale.y:" + m_equipTipCameraArea.localScale.y); minY = minY > 0 ? minY : 0; m_equipTipCamera.MINY = m_equipTipCameraPosBegin.localPosition.y - minY; m_equipTipCamera.transform.localPosition = m_equipTipCameraPosBegin.localPosition; InitButtonList(buttonList); this.gameObject.SetActive(true); }
protected override void InitializeObjects() { base.InitializeObjects(); var topView = new UIView(); var scrollView = new UIScrollView(); var topTextRowView = new UIView(); var centerTextRowView = new UIView(); var bottomTextRowView = new UIView(); var bottomView = new UIView(); var profileNavigationBarBackground = new UIImageView(UIImage.FromBundle(@"Images/navigation_bar_background.png")); backHomeView = UIButton.FromType(UIButtonType.Custom); backHomeView.SetImage(UIImage.FromFile(@"Images/ic_back.png"), UIControlState.Normal); nameOfPageLabel = LabelInformationAboutPage(UIColor.White, "Profile", UIFont.BoldSystemFontOfSize(16f)); informationAboutPageLabel = LabelInformationAboutPage(UIColor.FromRGB(29, 157, 189), "Please, Enter Your Personal Information.", UIFont.FromName("Helvetica", 14f)); // Hide navigation bar NavigationController.SetNavigationBarHidden(true, false); View.BackgroundColor = UIColor.FromPatternImage(UIImage.FromFile(@"Images/tab_background.png").Scale(View.Frame.Size)); profileNavigationBarBackground.Frame = new CGRect(10, 10, profileNavigationBarBackground.Image.CGImage.Width, profileNavigationBarBackground.Image.CGImage.Height); var labelView = new UIView(); labelView.AddIfNotNull(nameOfPageLabel, informationAboutPageLabel); labelView.AddConstraints( nameOfPageLabel.AtTopOf(labelView, 20), nameOfPageLabel.WithSameCenterX(labelView), nameOfPageLabel.WithSameCenterY(labelView), nameOfPageLabel.WithSameWidth(labelView), nameOfPageLabel.WithRelativeHeight(labelView, 0.3f), informationAboutPageLabel.Below(nameOfPageLabel, 5), informationAboutPageLabel.WithSameWidth(labelView), informationAboutPageLabel.WithSameCenterX(labelView), informationAboutPageLabel.WithRelativeHeight(labelView, 0.3f) ); topView.AddIfNotNull(profileNavigationBarBackground, backHomeView, labelView); topView.AddConstraints( profileNavigationBarBackground.WithSameWidth(topView), profileNavigationBarBackground.WithSameHeight(topView), profileNavigationBarBackground.AtTopOf(topView), backHomeView.WithSameCenterY(topView), backHomeView.AtLeftOf(topView, 20), backHomeView.WithRelativeWidth(topView, 0.1f), backHomeView.WithRelativeHeight(topView, 0.2f), labelView.WithSameCenterX(topView), labelView.WithSameCenterY(topView), labelView.WithRelativeWidth(topView, 0.8f), labelView.WithRelativeHeight(topView, 0.6f) ); firstNameTextField = TextFieldInitializer("First Name"); lastNameTextField = TextFieldInitializer("Last Name"); emailTextField = TextFieldInitializer("Email"); addressTextField = TextFieldInitializer("Address"); cityTextField = TextFieldInitializer("City"); zipCodeTextField = TextFieldInitializer("Zip Code"); stateTextField = TextFieldInitializer("State"); statesPicker = new UIPickerView(); statesPickerViewModel = new MvxPickerViewModel(statesPicker); statesPicker.Model = statesPickerViewModel; statesPicker.ShowSelectionIndicator = true; statesPicker.BackgroundColor = UIColor.White; addLicenseButton = ProfileButtonManager.ButtonInitiaziler("Add License Plate", UIImage.FromFile(@"Images/ProfileView/ic_license.png")); addCreditCardButton = ProfileButtonManager.ButtonInitiaziler("Add Credit Card", UIImage.FromFile(@"Images/ProfileView/ic_card.png")); topTextRowView.AddIfNotNull(firstNameTextField, lastNameTextField); topTextRowView.AddConstraints( firstNameTextField.AtTopOf(topTextRowView), firstNameTextField.AtLeftOf(topTextRowView), firstNameTextField.WithRelativeWidth(topTextRowView, 0.475f), firstNameTextField.WithSameHeight(topTextRowView), lastNameTextField.AtTopOf(topTextRowView), lastNameTextField.AtRightOf(topTextRowView), lastNameTextField.WithRelativeWidth(topTextRowView, 0.475f), lastNameTextField.WithSameHeight(topTextRowView) ); centerTextRowView.AddIfNotNull(emailTextField, addressTextField, cityTextField); centerTextRowView.AddConstraints( emailTextField.AtTopOf(centerTextRowView), emailTextField.WithSameCenterX(centerTextRowView), emailTextField.WithSameWidth(centerTextRowView), emailTextField.WithRelativeHeight(centerTextRowView, 0.3f), addressTextField.Below(emailTextField, 10), addressTextField.WithSameCenterX(centerTextRowView), addressTextField.WithSameWidth(centerTextRowView), addressTextField.WithRelativeHeight(centerTextRowView, 0.3f), cityTextField.Below(addressTextField, 10), cityTextField.WithSameCenterX(centerTextRowView), cityTextField.WithSameWidth(centerTextRowView), cityTextField.WithRelativeHeight(centerTextRowView, 0.3f) ); bottomTextRowView.AddIfNotNull(stateTextField, zipCodeTextField); bottomTextRowView.AddConstraints( stateTextField.AtTopOf(bottomTextRowView), stateTextField.AtLeftOf(bottomTextRowView), stateTextField.WithRelativeWidth(bottomTextRowView, 0.475f), stateTextField.WithSameHeight(bottomTextRowView), zipCodeTextField.AtTopOf(bottomTextRowView), zipCodeTextField.AtRightOf(bottomTextRowView), zipCodeTextField.WithRelativeWidth(bottomTextRowView, 0.475f), zipCodeTextField.WithSameHeight(bottomTextRowView) ); bottomView.AddIfNotNull(addLicenseButton, addCreditCardButton); bottomView.AddConstraints( addLicenseButton.AtTopOf(bottomView), addLicenseButton.WithSameCenterX(bottomView), addLicenseButton.WithSameWidth(bottomView), addLicenseButton.WithRelativeHeight(bottomView, 0.4f), addCreditCardButton.Below(addLicenseButton, 10), addCreditCardButton.WithSameCenterX(bottomView), addCreditCardButton.WithSameWidth(bottomView), addCreditCardButton.WithRelativeHeight(bottomView, 0.4f) ); scrollView.AddIfNotNull(topTextRowView, centerTextRowView, bottomTextRowView, bottomView); scrollView.AddConstraints( topTextRowView.AtTopOf(scrollView, 30), topTextRowView.WithSameWidth(scrollView), topTextRowView.WithSameCenterX(scrollView), topTextRowView.WithRelativeHeight(scrollView, 0.12f), centerTextRowView.Below(topTextRowView, 10), centerTextRowView.WithSameWidth(scrollView), centerTextRowView.AtLeftOf(scrollView), centerTextRowView.AtRightOf(scrollView), centerTextRowView.WithRelativeHeight(scrollView, 0.4f), bottomTextRowView.Below(centerTextRowView, 10), bottomTextRowView.WithSameWidth(scrollView), bottomTextRowView.WithSameCenterX(scrollView), bottomTextRowView.WithRelativeHeight(scrollView, 0.12f), bottomView.Below(bottomTextRowView, 10), bottomView.WithSameWidth(scrollView), bottomView.AtLeftOf(scrollView), bottomView.AtRightOf(scrollView), bottomView.AtBottomOf(scrollView, 100), bottomView.WithRelativeHeight(scrollView, 0.27f) ); View.AddIfNotNull(topView, scrollView); View.AddConstraints( topView.AtTopOf(View), topView.WithSameWidth(View), topView.WithRelativeHeight(View, 0.2f), scrollView.Below(topView, 30), scrollView.AtLeftOf(View, 30), scrollView.AtRightOf(View, 30), scrollView.WithRelativeHeight(View, 0.8f) ); EnableNextKeyForTextFields(firstNameTextField.TextFieldWithValidator.TextField, lastNameTextField.TextFieldWithValidator.TextField, emailTextField.TextFieldWithValidator.TextField, addressTextField.TextFieldWithValidator.TextField, cityTextField.TextFieldWithValidator.TextField, stateTextField.TextFieldWithValidator.TextField, zipCodeTextField.TextFieldWithValidator.TextField); }
public void Include(UILabel label) { label.Text = label.Text + ""; label.AttributedText = new NSAttributedString(label.AttributedText.ToString() + ""); }
UIView GetItemView(SerializationModel model, CGRect frame) { UIButton button = new UIButton(frame); UIImageView imageView = new UIImageView(new CGRect(0, 5, frame.Width, frame.Height - 20)); imageView.Alpha = 1f; imageView.Image = model.Image; imageView.BackgroundColor = model.ImageBackgroundColor; imageView.ContentMode = model.ImageAlignment; button.AddSubview(imageView); UILabel label = new UILabel(); if (model.Name != "Create New") { label.Frame = new CGRect(0, frame.Height - 40, frame.Width, 25); label.Alpha = 0.5f; label.BackgroundColor = UIColor.LightGray; if (model.IsImageSelected) { UIImageView SelectedView = new UIImageView(new CGRect(frame.Width - 25, 10, 20, 20)); if (!model.IsItemSelectedToDelete) { SelectedView.Image = UIImage.FromBundle("Images/ImageEditor/NotSelected.png"); imageView.Alpha = 1f; } else { SelectedView.Image = UIImage.FromBundle("Images/ImageEditor/Selected.png"); imageView.Alpha = 0.3f; } SelectedView.BackgroundColor = UIColor.Clear; SelectedView.ContentMode = UIViewContentMode.ScaleAspectFit; button.AddSubview(SelectedView); } } else { if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) { label.Frame = new CGRect(0, frame.Height / 2 + 50, frame.Width, 25); } else { label.Frame = new CGRect(0, frame.Height / 2 + 20, frame.Width, 25); } label.Alpha = 1f; label.BackgroundColor = UIColor.Clear; label.TextColor = UIColor.White; } label.Font = UIFont.SystemFontOfSize(18); label.TextAlignment = UITextAlignment.Center; label.Text = model.Name; button.AddSubview(label); UILongPressGestureRecognizer detector = new UILongPressGestureRecognizer((UILongPressGestureRecognizer obj) => { OnLongPressed(this, model); }); button.AddGestureRecognizer(detector); button.TouchUpInside += (sender, e) => { OnItemSelected(this, model); }; return(button); }
protected virtual void BindTitle(UILabel title, MvxFluentBindingDescriptionSet <HistoryOrderProductCell, IHistoryOrderProductItemVM> set) { set.Bind(title).To(vm => vm.Title); }
public override async void ViewDidLoad() { base.ViewDidLoad(); this.NavigationItem.Title = "Nuca App"; getadvs gn = new getadvs(); var news = await gn.GetAdvsById(Id); headingLabel = new UILabel() { Text = news.title, Font = UIFont.FromName("Helvetica", 22f), TextColor = UIColor.Blue, BackgroundColor = UIColor.Clear, TextAlignment = UITextAlignment.Center }; subheadingLabel = new UILabel() { Text = news.shortdesc, Font = UIFont.FromName("Helvetica", 20f), TextColor = UIColor.Black, BackgroundColor = UIColor.Clear, TextAlignment = UITextAlignment.Right }; linkurl = new UITextView() { Text = news.liqo, Font = UIFont.FromName("Helvetica", 20f), TextColor = UIColor.Blue, BackgroundColor = UIColor.Clear, TextAlignment = UITextAlignment.Left, Editable = false, Selectable = true, DataDetectorTypes = UIDataDetectorType.Link, UserInteractionEnabled = true }; subheadingLabel.LineBreakMode = UILineBreakMode.WordWrap; subheadingLabel.Lines = 0; subheadingLabel.SizeToFit(); linkurl.ShouldInteractWithUrl += delegate { return(true); }; linkurl.SizeToFit(); imagepath = new UIImageView() { ContentMode = UIViewContentMode.ScaleAspectFit, }; ImageService.Instance.LoadUrl(news.image).Into(imagepath); headingLabel.Frame = new CGRect(15, 75, this.View.Bounds.Size.Width - 30, 25); imagepath.Frame = new CGRect(this.View.Bounds.Size.Width / 4, 110, this.View.Bounds.Size.Width / 2, 400); subheadingLabel.Frame = new CGRect(15, 515, this.View.Bounds.Size.Width - 30, 50); linkurl.Frame = new CGRect(15, 570, this.View.Bounds.Size.Width - 30, 50); this.View.AddSubview(headingLabel.ViewForBaselineLayout); this.View.AddSubview(imagepath.ViewForBaselineLayout); this.View.AddSubview(subheadingLabel.ViewForBaselineLayout); this.View.AddSubview(linkurl.ViewForBaselineLayout); }
protected virtual void SetupPrice(UILabel price) { price.SetupStyle(ThemeConfig.HistoryOrderItemCell.TotalPrice); }
protected virtual void SetupBadge(UILabel badge) { badge.SetupStyle(ThemeConfig.HistoryOrderItemCell.Badge); }
/// <summary> /// 新添加 /// </summary> /// <param name="textList"></param> private void OnAddText(IEnumerable <ChatInfo> textList) { if (!gameObject.activeSelf) { m_lsttextList.AddRange(textList); return; } var list = textList.TakeLast(MaxChatNum).ToList(); foreach (var item in list) { if (item.IsRedPacket) {//红包不显示 continue; } UIXmlRichText xmlText; if (!RemoveOverfloorChat(out xmlText)) { GameObject go = GameObject.Instantiate(m_chatItemPrefab) as GameObject; xmlText = go.transform.Find("richtext").GetComponent <UIXmlRichText>(); go.GetComponent <UIWidget>().width = (int)m_UIPanel.baseClipRegion.z - 10; xmlText.UrlClicked += OnClickUrl; } xmlText.fontSize = 20; Transform root = xmlText.transform.parent; root.gameObject.SetActive(true); xmlText.AddXml(item.Title + item.Content); xmlText.gameObject.SetActive(true); Transform t = xmlText.transform; root.parent = m_trans_chatItemRoot; root.localPosition = Vector3.zero; root.localScale = Vector3.one; root.localRotation = Quaternion.identity; UILabel[] uilabelArray = t.GetComponentsInChildren <UILabel>(); if (uilabelArray.Length > 0) { UILabel lableTitle = uilabelArray[0]; if (lableTitle != null) { UISpriteEx spriteBg = root.transform.Find("titlebg").GetComponent <UISpriteEx>(); if (spriteBg != null) { spriteBg.ChangeSprite(SingleChatItem.GetChannelIndex(item.Channel)); } // spriteBg.transform.parent = title; spriteBg.pivot = lableTitle.pivot; spriteBg.transform.localPosition = new Vector3(lableTitle.transform.localPosition.x - 3, lableTitle.transform.localPosition.y, 0); spriteBg.height = lableTitle.height + 5; spriteBg.width = lableTitle.width + 3; } } float height = xmlText.GetTotalHeight() + 5; foreach (var moveItem in m_lstxmlText) { Vector3 pos = moveItem.transform.parent.localPosition; pos.y -= height; moveItem.transform.parent.localPosition = pos; xmlText.name = pos.y.ToString(); } m_lstxmlText.Add(xmlText); } float offsetY = m_chatScrollview.panel.clipOffset.y + 1; if (offsetY < 0) { m_chatScrollview.MoveRelative(new Vector3(0, offsetY));//取反 往下相对移动 } }
protected virtual void SetupAmount(UILabel amount) { amount.SetupStyle(ThemeConfig.HistoryOrderItemCell.Amount); }
public override void LoadView() { // Create the views. View = new UIView { BackgroundColor = ApplicationTheme.BackgroundColor }; _myMapView = new MapView(); _myMapView.TranslatesAutoresizingMaskIntoConstraints = false; _topView = new UIView { BackgroundColor = ApplicationTheme.BackgroundColor, TranslatesAutoresizingMaskIntoConstraints = false }; _defaultView = new UIStackView { TranslatesAutoresizingMaskIntoConstraints = false, Spacing = 8, LayoutMarginsRelativeArrangement = true, Alignment = UIStackViewAlignment.Top, LayoutMargins = new UIEdgeInsets(8, 8, 8, 8), Axis = UILayoutConstraintAxis.Vertical, }; UILabel instructions = new UILabel { TranslatesAutoresizingMaskIntoConstraints = false, Text = "Tap to select a feature." }; _versionLabel = new UILabel { TranslatesAutoresizingMaskIntoConstraints = false, }; _versionButton = new UIButton { TranslatesAutoresizingMaskIntoConstraints = false, Enabled = false }; _versionButton.SetTitle("Create version", UIControlState.Normal); _versionButton.SetTitleColor(View.TintColor, UIControlState.Normal); _defaultView.AddArrangedSubview(instructions); _defaultView.AddArrangedSubview(_versionLabel); _defaultView.AddArrangedSubview(_versionButton); _versionView = new UIStackView { TranslatesAutoresizingMaskIntoConstraints = false, Spacing = 8, LayoutMarginsRelativeArrangement = true, Alignment = UIStackViewAlignment.Top, LayoutMargins = new UIEdgeInsets(8, 8, 8, 8), Axis = UILayoutConstraintAxis.Vertical, Hidden = true, }; _nameField = new UITextField { Placeholder = "Name", }; _proButton = new UIButton { }; _proButton.SetTitle("Protection:", UIControlState.Normal); _proButton.SetTitleColor(View.TintColor, UIControlState.Normal); _descriptionField = new UITextField { Placeholder = "Description" }; _confirmButton = new UIButton { }; _confirmButton.SetTitle("Confirm", UIControlState.Normal); _confirmButton.SetTitleColor(View.TintColor, UIControlState.Normal); _cancelButton = new UIButton { }; _cancelButton.SetTitle("Cancel", UIControlState.Normal); _cancelButton.SetTitleColor(UIColor.Red, UIControlState.Normal); _versionView.AddArrangedSubview(_nameField); _versionView.AddArrangedSubview(_proButton); _versionView.AddArrangedSubview(_descriptionField); _versionView.AddArrangedSubview(getRowStackView(new UIView[] { _confirmButton, _cancelButton })); _damageView = new UIStackView { TranslatesAutoresizingMaskIntoConstraints = false, Spacing = 8, LayoutMarginsRelativeArrangement = true, Alignment = UIStackViewAlignment.Top, LayoutMargins = new UIEdgeInsets(8, 8, 8, 8), Axis = UILayoutConstraintAxis.Vertical, Hidden = true, }; _moveText = new UILabel { TranslatesAutoresizingMaskIntoConstraints = false, Text = "Tap to move feature." }; _damageButton = new UIButton { }; _damageButton.SetTitle("Damage:", UIControlState.Normal); _damageButton.SetTitleColor(View.TintColor, UIControlState.Normal); _closeButton = new UIButton { }; _closeButton.SetTitle("Close", UIControlState.Normal); _closeButton.SetTitleColor(UIColor.Red, UIControlState.Normal); _damageView.AddArrangedSubview(_moveText); _damageView.AddArrangedSubview(_damageButton); _damageView.AddArrangedSubview(_closeButton); _topView.AddSubviews(_defaultView, _versionView, _damageView); // Add the views. View.AddSubviews(_myMapView, _topView); // Lay out the views. NSLayoutConstraint.ActivateConstraints(new[] { _topView.TopAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TopAnchor), _topView.LeadingAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.LeadingAnchor), _topView.TrailingAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TrailingAnchor), _topView.HeightAnchor.ConstraintEqualTo(150), _myMapView.TopAnchor.ConstraintEqualTo(_topView.BottomAnchor), _myMapView.BottomAnchor.ConstraintEqualTo(View.BottomAnchor), _myMapView.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor), _myMapView.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor), }); }
protected virtual void BindPrice(UILabel price, MvxFluentBindingDescriptionSet <HistoryOrderProductCell, IHistoryOrderProductItemVM> set) { set.Bind(price).To(vm => vm.TotalPrice).WithConversion("PriceFormat"); }
public void ShowJewelTip(string level, string type, string desp, string stack, List <ButtonInfo> buttonList) { EventDispatcher.TriggerEvent(SettingEvent.UIUpPlaySound, "ItemTip"); m_equipDetailImageUsed.gameObject.SetActive(false); float gap = -20; ReleaseInstance(); Transform root = transform.FindChild(m_widgetToFullName["EquipTipDetailList"]); //加载+排版 //int i = 0; //添加等级 var _gap = gap; GetInstance("MaterialInfoDetailLevel.prefab", (gameObject) => { GameObject go = gameObject as GameObject; Utils.MountToSomeObjWithoutPosChange(go.transform, root); UILabel lable = go.transform.FindChild("MaterialInfoDetailLevelNum").GetComponent <UILabel>(); lable.text = level; Vector3 position = go.transform.localPosition; go.transform.localPosition = new Vector3(0, _gap, 0); gos.Add(go); } ); gap -= 22 + GAP; //添加类型 var _gap6 = gap; GetInstance("MaterialInfoDetailType.prefab", (gameObject) => { GameObject go = gameObject as GameObject; Utils.MountToSomeObjWithoutPosChange(go.transform, root); UILabel lable = go.transform.FindChild("MaterialInfoDetailTypeNum").GetComponent <UILabel>(); lable.text = type; Vector3 position = go.transform.localPosition; go.transform.localPosition = new Vector3(0, _gap6, 0); gos.Add(go); } ); gap -= 22 + GAP; //添加描述 var _gap5 = gap; GetInstance("PropInfoDetailEffectNum.prefab", (gameObject) => { GameObject go = gameObject as GameObject; Utils.MountToSomeObjWithoutPosChange(go.transform, root); UILabel lable = go.transform.GetComponentsInChildren <UILabel>(true)[0]; lable.text = desp; Vector3 position = go.transform.localPosition; go.transform.localPosition = new Vector3(0, _gap5, 0); gos.Add(go); } ); DespLbl.text = desp; int height = (int)(DespLbl.relativeSize.y * DespLbl.transform.localScale.y); gap -= height + GAP; //添加堆叠 if (stack != "") { var _gap2 = gap; GetInstance("PropInfoDetailStack.prefab", (gameObject) => { //PackageEquipInfoDiamonHole0Text GameObject go = gameObject as GameObject; Utils.MountToSomeObjWithoutPosChange(go.transform, root); UILabel lable = go.transform.FindChild("PropInfoDetailStackNum").GetComponent <UILabel>(); lable.text = stack; Vector3 position = go.transform.localPosition; go.transform.localPosition = new Vector3(0, _gap2, 0); gos.Add(go); } ); gap -= GAP + 22; } float minY; minY = -gap + 3 - m_equipTipCameraArea.localScale.y; minY = minY > 0 ? minY : 0; m_equipTipCamera.MINY = m_equipTipCameraPosBegin.localPosition.y - minY; m_equipTipCamera.transform.localPosition = m_equipTipCameraPosBegin.localPosition; //m_equipTipCamera.height = gap - 400; //m_equipTipCamera.Reset(); //show InitButtonList(buttonList); this.gameObject.SetActive(true); }
protected virtual void BindBadge(UILabel badge, MvxFluentBindingDescriptionSet <HistoryOrderProductCell, IHistoryOrderProductItemVM> set) { set.Bind(badge).To(vm => vm.Badge); }
public void ShowMaterialTip(string level, string desp, string stack, string price, List <ButtonInfo> buttonList) { EventDispatcher.TriggerEvent(SettingEvent.UIUpPlaySound, "ItemTip"); m_equipDetailImageUsed.gameObject.SetActive(false); float GAP = 18; float gap = -20; ReleaseInstance(); Transform root = transform.FindChild(m_widgetToFullName["EquipTipDetailList"]); //加载+排版 //int i = 0; //添加等级 var _gap = gap; GetInstance("MaterialInfoDetailLevel.prefab", (gameObject) => { GameObject go = gameObject as GameObject; Utils.MountToSomeObjWithoutPosChange(go.transform, root); UILabel lable = go.transform.FindChild("MaterialInfoDetailLevelNum").GetComponent <UILabel>(); lable.text = level; Vector3 position = go.transform.localPosition; go.transform.localPosition = new Vector3(0, _gap, 0); gos.Add(go); } ); gap -= 22 + GAP; var _gap6 = gap; //添加材料类型 GetInstance("MaterialInfoDetailType.prefab", (gameObject) => { GameObject go = gameObject as GameObject; Utils.MountToSomeObjWithoutPosChange(go.transform, root); Vector3 position = go.transform.localPosition; go.transform.localPosition = new Vector3(0, _gap6, 0); gos.Add(go); } ); gap -= 22 + GAP; var _gap5 = gap; //添加描述 GetInstance("PropInfoDetailEffectNum.prefab", (gameObject) => { GameObject go = gameObject as GameObject; Utils.MountToSomeObjWithoutPosChange(go.transform, root); UILabel lable = go.transform.GetComponentsInChildren <UILabel>(true)[0]; lable.text = desp; Vector3 position = go.transform.localPosition; go.transform.localPosition = new Vector3(0, _gap5, 0); gos.Add(go); } ); //int lineCount = despLineWidth / fontSize; //lineCount = desp.Length / lineCount + 1; //int height = lineCount * fontSize; DespLbl.text = desp; int height = (int)(DespLbl.relativeSize.y * DespLbl.transform.localScale.y); gap -= height + GAP; //添加堆叠 if (stack != "") { var _gap2 = gap; GetInstance("PropInfoDetailStack.prefab", (gameObject) => { //PackageEquipInfoDiamonHole0Text GameObject go = gameObject as GameObject; Utils.MountToSomeObjWithoutPosChange(go.transform, root); UILabel lable = go.transform.FindChild("PropInfoDetailStackNum").GetComponent <UILabel>(); lable.text = stack; Vector3 position = go.transform.localPosition; go.transform.localPosition = new Vector3(0, _gap2, 0); gos.Add(go); } ); gap -= GAP + 22; } //添加价钱 if (price != "") { var _gap3 = gap; GetInstance("PropInfoDetailPrice.prefab", (gameObject) => { //PackageEquipInfoDiamonHole0Text GameObject go = gameObject as GameObject; Utils.MountToSomeObjWithoutPosChange(go.transform, root); UILabel lable = go.transform.FindChild("PropInfoDetailPriceNum").GetComponent <UILabel>(); UISprite icon = go.transform.FindChild("PropInfoDetailPriceIcon").GetComponent <UISprite>(); lable.text = price; float dis = lable.font.CalculatePrintedSize(lable.text, false, UIFont.SymbolStyle.None).x * 22; Vector3 position = lable.transform.localPosition; icon.transform.localPosition = new Vector3(12 /*position.x + dis + 2*/, icon.transform.localPosition.y, position.z); position = go.transform.localPosition; go.transform.localPosition = new Vector3(0, _gap3, 0); gos.Add(go); } ); } gap -= 22; //gap -= 10;//预留位置 //gap = -gap; float minY; minY = -gap + 3 - m_equipTipCameraArea.localScale.y; minY = minY > 0 ? minY : 0; m_equipTipCamera.MINY = m_equipTipCameraPosBegin.localPosition.y - minY; m_equipTipCamera.transform.localPosition = m_equipTipCameraPosBegin.localPosition; //m_equipTipCamera.height = gap - 400; //m_equipTipCamera.Reset(); //show InitButtonList(buttonList); this.gameObject.SetActive(true); }
protected virtual void BindAmount(UILabel amount, MvxFluentBindingDescriptionSet <HistoryOrderProductCell, IHistoryOrderProductItemVM> set) { set.Bind(amount).To(vm => vm.Amount).WithConversion("StringFormat", $"{{0}} {Mvx.Resolve<ILocalizationService>().GetLocalizableString(HistoryOrdersConstants.RESX_NAME, "HistoryOrderProducts_Pieces")}"); }
void Awake() { Instance = GetComponentsInChildren <EquipTipManager>(true)[0]; FillFullNameData(transform); m_equipTip = transform.FindChild(m_widgetToFullName["EquipTip"]).gameObject; m_equipTipDetail = transform.FindChild(m_widgetToFullName["EquipTipDetail3"]).gameObject; m_equipDetailName = transform.FindChild(m_widgetToFullName["EquipTipNameText"]).GetComponentsInChildren <UILabel>(true)[0]; m_equipDetailNeedLevel = transform.FindChild(m_widgetToFullName["EquipTipDetailNeedLevelNum"]).GetComponentsInChildren <UILabel>(true)[0]; //m_equipDetailGrowLevel = m_myTransform.FindChild(m_widgetToFullName["EquipTipDetailGrowLevelNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipDetailNeedJob = transform.FindChild(m_widgetToFullName["EquipTipDetailNeedJobText"]).GetComponentsInChildren <UILabel>(true)[0]; m_equipDetailExtra = transform.FindChild(m_widgetToFullName["EquipTipDetailExtraText"]).GetComponentsInChildren <UILabel>(true)[0]; m_equipDetailImageFG = transform.FindChild(m_widgetToFullName["EquipTipDetailImageFG"]).GetComponentsInChildren <UISlicedSprite>(true)[0]; m_equipDetailImageBG = transform.FindChild(m_widgetToFullName["EquipTipDetailImageBG"]).GetComponentsInChildren <UISlicedSprite>(true)[0]; m_equipDetailImageUsed = transform.FindChild(m_widgetToFullName["EquipTipDetailImageUsed"]).GetComponentsInChildren <UISlicedSprite>(true)[0]; m_equipTipCamera = transform.FindChild(m_widgetToFullName["EquipTipDetailCamera"]).GetComponentsInChildren <MyDragableCamera>(true)[0]; m_equipTipCamera.GetComponent <UIViewport>().sourceCamera = GameObject.Find("GlobleUICamera").GetComponent <Camera>(); m_equipTipCameraPosBegin = transform.FindChild(m_widgetToFullName["EquipTipDetailBegin"]); m_equipTipCameraArea = transform.FindChild(m_widgetToFullName["EquipTipDetailInfoBG"]); m_equipDetailNeedLevellbl = transform.FindChild(m_widgetToFullName["EquipTipDetailNeedLevelText"]).GetComponentsInChildren <UILabel>(true)[0]; m_equipTipCurrent = transform.FindChild(m_widgetToFullName["EquipTipCurrent"]).gameObject; m_equipDetailNeedLevellblCurrent = transform.FindChild(m_widgetToFullName["EquipTipCurrentDetailNeedLevelText"]).GetComponentsInChildren <UILabel>(true)[0]; m_equipTipDetailCurrent = transform.FindChild(m_widgetToFullName["EquipTipCurrentDetail3"]).gameObject; m_equipDetailNameCurrent = transform.FindChild(m_widgetToFullName["EquipTipCurrentNameText"]).GetComponentsInChildren <UILabel>(true)[0]; m_equipDetailNeedLevelCurrent = transform.FindChild(m_widgetToFullName["EquipTipCurrentDetailNeedLevelNum"]).GetComponentsInChildren <UILabel>(true)[0]; //m_equipDetailGrowLevel = m_myTransform.FindChild(m_widgetToFullName["EquipTipDetailGrowLevelNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipDetailNeedJobCurrent = transform.FindChild(m_widgetToFullName["EquipTipCurrentDetailNeedJobText"]).GetComponentsInChildren <UILabel>(true)[0]; m_equipDetailExtraCurrent = transform.FindChild(m_widgetToFullName["EquipTipCurrentDetailExtraText"]).GetComponentsInChildren <UILabel>(true)[0]; m_equipDetailImageFGCurrent = transform.FindChild(m_widgetToFullName["EquipTipCurrentDetailImageFG"]).GetComponentsInChildren <UISlicedSprite>(true)[0]; m_equipDetailImageBGCurrent = transform.FindChild(m_widgetToFullName["EquipTipCurrentDetailImageBG"]).GetComponentsInChildren <UISlicedSprite>(true)[0]; m_equipDetailImageUsedCurrent = transform.FindChild(m_widgetToFullName["EquipTipCurrentDetailImageUsed"]).GetComponentsInChildren <UISlicedSprite>(true)[0]; m_equipTipCameraCurrent = transform.FindChild(m_widgetToFullName["EquipTipCurrentDetailCamera"]).GetComponentsInChildren <MyDragableCamera>(true)[0]; m_equipTipCameraCurrent.GetComponent <UIViewport>().sourceCamera = GameObject.Find("GlobleUICamera").GetComponent <Camera>(); m_equipTipCameraPosBeginCurrent = transform.FindChild(m_widgetToFullName["EquipTipCurrentDetailBegin"]); m_equipTipCameraAreaCurrent = transform.FindChild(m_widgetToFullName["EquipTipCurrentDetailInfoBG"]); center = transform.FindChild(m_widgetToFullName["Center"]); right = transform.FindChild(m_widgetToFullName["Right"]); //if (m_equipTipCurrent == null) Mogo.Util.LoggerHelper.Debug("f**k!"); transform.FindChild(m_widgetToFullName["EquipTipClose"]).gameObject.AddComponent <EquipTipClose>(); m_goGOEquipTipDetailScore = transform.FindChild(m_widgetToFullName["GOEquipTipDetailScore"]).gameObject; m_lblEquipTipDetailScoreNum = transform.FindChild(m_widgetToFullName["EquipTipDetailScoreNum"]).GetComponentsInChildren <UILabel>(true)[0]; m_goGOEquipTipCurrentDetailScore = transform.FindChild(m_widgetToFullName["GOEquipTipCurrentDetailScore"]).gameObject; m_lblEquipTipCurrentDetailScoreNum = transform.FindChild(m_widgetToFullName["EquipTipCurrentDetailScoreNum"]).GetComponentsInChildren <UILabel>(true)[0]; //预加载 InitPrefabDic(); this.gameObject.SetActive(false); m_equipTipCurrent.SetActive(false); }
private void SetupPanel() { this.name = "PublicTransportStopWorldInfoPanel"; this.isVisible = false; this.canFocus = true; this.isInteractive = true; this.anchor = UIAnchorStyle.None; this.pivot = UIPivotPoint.BottomLeft; this.width = 380f; this.height = 280f; this.backgroundSprite = "InfoBubbleVehicle"; UIPanel uiPanel1 = this.AddUIComponent <UIPanel>(); string str1 = "Caption"; uiPanel1.name = str1; double width = (double)this.width; uiPanel1.width = (float)width; double num1 = 40.0; uiPanel1.height = (float)num1; Vector3 vector3_1 = new Vector3(0.0f, 0.0f); uiPanel1.relativePosition = vector3_1; UISprite uiSprite1 = uiPanel1.AddUIComponent <UISprite>(); uiSprite1.name = "VehicleType"; uiSprite1.size = new Vector2(32f, 22f); uiSprite1.relativePosition = new Vector3(8f, 9f, 0.0f); this.m_VehicleType = uiSprite1; UITextField uiTextField = uiPanel1.AddUIComponent <UITextField>(); uiTextField.name = "StopName"; uiTextField.font = UIHelper.Font; uiTextField.height = 25f; uiTextField.width = 200f; uiTextField.maxLength = 32; uiTextField.builtinKeyNavigation = true; uiTextField.submitOnFocusLost = true; uiTextField.focusedBgSprite = "TextFieldPanel"; uiTextField.hoveredBgSprite = "TextFieldPanelHovered"; uiTextField.padding = new RectOffset(0, 0, 4, 0); uiTextField.selectionSprite = "EmptySprite"; uiTextField.verticalAlignment = UIVerticalAlignment.Middle; uiTextField.position = new Vector3((float)((double)this.width / 2.0 - (double)uiTextField.width / 2.0), (float)((double)uiTextField.height / 2.0 - 20.0)); uiTextField.eventTextSubmitted += new PropertyChangedEventHandler <string>(this.OnRename); this.m_StopName = uiTextField; DropDown dropDown = DropDown.Create((UIComponent)uiPanel1); dropDown.name = "SuggestedNames"; dropDown.size = new Vector2(30f, 25f); dropDown.ListWidth = 200f; dropDown.DropDownPanelAlignParent = (UIComponent)this; dropDown.Font = UIHelper.Font; dropDown.position = new Vector3((float)((double)this.width / 2.0 + (double)uiTextField.width / 2.0), (float)((double)dropDown.height / 2.0 - 20.0)); dropDown.tooltip = Localization.Get("STOP_PANEL_SUGGESTED_NAMES_TOOLTIP"); dropDown.ShowPanel = false; dropDown.eventSelectedItemChanged += new PropertyChangedEventHandler <ushort>(this.OnSelectedItemChanged); this.m_SuggestedNames = dropDown; UIButton uiButton1 = uiPanel1.AddUIComponent <UIButton>(); uiButton1.name = "ReuseName"; uiButton1.tooltip = Localization.Get("STOP_PANEL_REUSE_NAME_TOOLTIP"); uiButton1.size = new Vector2(30f, 30f); uiButton1.normalBgSprite = "IconPolicyRecycling"; uiButton1.hoveredBgSprite = "IconPolicyRecyclingHovered"; uiButton1.pressedBgSprite = "IconPolicyRecyclingPressed"; uiButton1.relativePosition = new Vector3((float)((double)this.width - 32.0 - (double)uiButton1.width - 2.0), 6f); uiButton1.eventClick += new MouseEventHandler(this.OnReuseNameButtonClick); UIButton uiButton2 = uiPanel1.AddUIComponent <UIButton>(); uiButton2.name = "Close"; uiButton2.size = new Vector2(32f, 32f); uiButton2.normalBgSprite = "buttonclose"; uiButton2.hoveredBgSprite = "buttonclosehover"; uiButton2.pressedBgSprite = "buttonclosepressed"; uiButton2.relativePosition = new Vector3((float)((double)this.width - (double)uiButton2.width - 2.0), 2f); uiButton2.eventClick += new MouseEventHandler(this.OnCloseButtonClick); UIPanel uiPanel2 = this.AddUIComponent <UIPanel>(); string str2 = "Container"; uiPanel2.name = str2; double num2 = 365.0; uiPanel2.width = (float)num2; double num3 = 197.0; uiPanel2.height = (float)num3; int num4 = 1; uiPanel2.autoLayout = num4 != 0; int num5 = 1; uiPanel2.autoLayoutDirection = (LayoutDirection)num5; RectOffset rectOffset1 = new RectOffset(10, 10, 5, 0); uiPanel2.autoLayoutPadding = rectOffset1; int num6 = 0; uiPanel2.autoLayoutStart = (LayoutStart)num6; Vector3 vector3_2 = new Vector3(6f, 46f); uiPanel2.relativePosition = vector3_2; UIPanel uiPanel3 = uiPanel2.AddUIComponent <UIPanel>(); string str3 = "PassengerCountPanel"; uiPanel3.name = str3; int num7 = 13; uiPanel3.anchor = (UIAnchorStyle)num7; int num8 = 1; uiPanel3.autoLayout = num8 != 0; int num9 = 0; uiPanel3.autoLayoutDirection = (LayoutDirection)num9; RectOffset rectOffset2 = new RectOffset(0, 5, 0, 0); uiPanel3.autoLayoutPadding = rectOffset2; int num10 = 0; uiPanel3.autoLayoutStart = (LayoutStart)num10; Vector2 vector2_1 = new Vector2(345f, 14f); uiPanel3.size = vector2_1; UILabel uiLabel1 = uiPanel3.AddUIComponent <UILabel>(); uiLabel1.name = "PassengerCount"; uiLabel1.font = UIHelper.Font; uiLabel1.autoSize = true; uiLabel1.height = 15f; uiLabel1.textScale = 13f / 16f; uiLabel1.textColor = new Color32((byte)185, (byte)221, (byte)254, byte.MaxValue); this.m_PassengerCount = uiLabel1; UIPanel uiPanel4 = uiPanel2.AddUIComponent <UIPanel>(); string str4 = "BoredCountdownPanel"; uiPanel4.name = str4; int num11 = 13; uiPanel4.anchor = (UIAnchorStyle)num11; int num12 = 1; uiPanel4.autoLayout = num12 != 0; int num13 = 0; uiPanel4.autoLayoutDirection = (LayoutDirection)num13; RectOffset rectOffset3 = new RectOffset(0, 5, 0, 0); uiPanel4.autoLayoutPadding = rectOffset3; int num14 = 0; uiPanel4.autoLayoutStart = (LayoutStart)num14; Vector2 vector2_2 = new Vector2(345f, 14f); uiPanel4.size = vector2_2; UILabel uiLabel2 = uiPanel4.AddUIComponent <UILabel>(); uiLabel2.name = "BoredCountdown"; uiLabel2.tooltip = Localization.Get("STOP_PANEL_BORED_TIMER_TOOLTIP"); uiLabel2.font = UIHelper.Font; uiLabel2.autoSize = true; uiLabel2.height = 15f; uiLabel2.textScale = 13f / 16f; uiLabel2.textColor = new Color32((byte)185, (byte)221, (byte)254, byte.MaxValue); uiLabel2.processMarkup = true; this.m_BoredCountdown = uiLabel2; UIPanel uiPanel5 = uiPanel2.AddUIComponent <UIPanel>(); string str5 = "PassengerStats"; uiPanel5.name = str5; int num15 = 13; uiPanel5.anchor = (UIAnchorStyle)num15; int num16 = 1; uiPanel5.autoLayout = num16 != 0; int num17 = 1; uiPanel5.autoLayoutDirection = (LayoutDirection)num17; RectOffset rectOffset4 = new RectOffset(0, 0, 0, 0); uiPanel5.autoLayoutPadding = rectOffset4; int num18 = 0; uiPanel5.autoLayoutStart = (LayoutStart)num18; Vector2 vector2_3 = new Vector2(349f, 75f); uiPanel5.size = vector2_3; UILabel uiLabel3; // ISSUE: explicit reference operation // ISSUE: variable of a reference type UILabel& label1_1 = @uiLabel3; UILabel uiLabel4; // ISSUE: explicit reference operation // ISSUE: variable of a reference type UILabel& label2_1 = @uiLabel4; UILabel uiLabel5; // ISSUE: explicit reference operation // ISSUE: variable of a reference type UILabel& label3_1 = @uiLabel5; UILabel uiLabel6; // ISSUE: explicit reference operation // ISSUE: variable of a reference type UILabel& label4_1 = @uiLabel6; int num19 = 1; PublicTransportStopWorldInfoPanel.CreateStatisticRow((UIComponent)uiPanel5, label1_1, label2_1, label3_1, label4_1, num19 != 0); uiLabel4.text = Localization.Get("CURRENT_WEEK"); uiLabel5.text = Localization.Get("LAST_WEEK"); uiLabel6.text = Localization.Get("AVERAGE"); uiLabel6.tooltip = string.Format(Localization.Get("AVERAGE_TOOLTIP"), (object)ImprovedPublicTransportMod.Settings.StatisticWeeks); // ISSUE: explicit reference operation // ISSUE: variable of a reference type UILabel& label1_2 = @uiLabel3; // ISSUE: explicit reference operation // ISSUE: variable of a reference type UILabel& label2_2 = @this.m_passengersInCurrent; // ISSUE: explicit reference operation // ISSUE: variable of a reference type UILabel& label3_2 = @this.m_passengersInLast; // ISSUE: explicit reference operation // ISSUE: variable of a reference type UILabel& label4_2 = @this.m_passengersInAverage; int num20 = 0; PublicTransportStopWorldInfoPanel.CreateStatisticRow((UIComponent)uiPanel5, label1_2, label2_2, label3_2, label4_2, num20 != 0); uiLabel3.text = Localization.Get("STOP_PANEL_PASSENGERS_IN"); uiLabel3.tooltip = Localization.Get("STOP_PANEL_PASSENGERS_IN_TOOLTIP"); // ISSUE: explicit reference operation // ISSUE: variable of a reference type UILabel& label1_3 = @uiLabel3; // ISSUE: explicit reference operation // ISSUE: variable of a reference type UILabel& label2_3 = @this.m_passengersOutCurrent; // ISSUE: explicit reference operation // ISSUE: variable of a reference type UILabel& label3_3 = @this.m_passengersOutLast; // ISSUE: explicit reference operation // ISSUE: variable of a reference type UILabel& label4_3 = @this.m_passengersOutAverage; int num21 = 0; PublicTransportStopWorldInfoPanel.CreateStatisticRow((UIComponent)uiPanel5, label1_3, label2_3, label3_3, label4_3, num21 != 0); uiLabel3.text = Localization.Get("STOP_PANEL_PASSENGERS_OUT"); uiLabel3.tooltip = Localization.Get("STOP_PANEL_PASSENGERS_OUT_TOOLTIP"); // ISSUE: explicit reference operation // ISSUE: variable of a reference type UILabel& label1_4 = @uiLabel3; // ISSUE: explicit reference operation // ISSUE: variable of a reference type UILabel& label2_4 = @this.m_passengersTotalCurrent; // ISSUE: explicit reference operation // ISSUE: variable of a reference type UILabel& label3_4 = @this.m_passengersTotalLast; // ISSUE: explicit reference operation // ISSUE: variable of a reference type UILabel& label4_4 = @this.m_passengersTotalAverage; int num22 = 0; PublicTransportStopWorldInfoPanel.CreateStatisticRow((UIComponent)uiPanel5, label1_4, label2_4, label3_4, label4_4, num22 != 0); uiLabel3.text = Localization.Get("STOP_PANEL_PASSENGERS_TOTAL"); uiLabel3.tooltip = Localization.Get("STOP_PANEL_PASSENGERS_TOTAL_TOOLTIP"); UIPanel uiPanel6 = uiPanel2.AddUIComponent <UIPanel>(); string str6 = "Unbunching"; uiPanel6.name = str6; int num23 = 13; uiPanel6.anchor = (UIAnchorStyle)num23; int num24 = 1; uiPanel6.autoLayout = num24 != 0; int num25 = 0; uiPanel6.autoLayoutDirection = (LayoutDirection)num25; RectOffset rectOffset5 = new RectOffset(0, 5, 0, 0); uiPanel6.autoLayoutPadding = rectOffset5; int num26 = 0; uiPanel6.autoLayoutStart = (LayoutStart)num26; Vector2 vector2_4 = new Vector2(345f, 25f); uiPanel6.size = vector2_4; int num27 = 1; uiPanel6.useCenter = num27 != 0; UICheckBox uiCheckBox = uiPanel6.AddUIComponent <UICheckBox>(); uiCheckBox.anchor = UIAnchorStyle.Left | UIAnchorStyle.CenterVertical; uiCheckBox.clipChildren = true; uiCheckBox.tooltip = Localization.Get("STOP_PANEL_UNBUNCHING_TOOLTIP") + System.Environment.NewLine + Localization.Get("EXPLANATION_UNBUNCHING"); uiCheckBox.eventClicked += new MouseEventHandler(this.OnUnbunchingClick); UISprite uiSprite2 = uiCheckBox.AddUIComponent <UISprite>(); uiSprite2.spriteName = "check-unchecked"; uiSprite2.size = new Vector2(16f, 16f); uiSprite2.relativePosition = Vector3.zero; uiCheckBox.checkedBoxObject = (UIComponent)uiSprite2.AddUIComponent <UISprite>(); ((UISprite)uiCheckBox.checkedBoxObject).spriteName = "check-checked"; uiCheckBox.checkedBoxObject.size = new Vector2(16f, 16f); uiCheckBox.checkedBoxObject.relativePosition = Vector3.zero; uiCheckBox.label = uiCheckBox.AddUIComponent <UILabel>(); uiCheckBox.label.font = UIHelper.Font; uiCheckBox.label.textColor = new Color32((byte)185, (byte)221, (byte)254, byte.MaxValue); uiCheckBox.label.disabledTextColor = (Color32)Color.black; uiCheckBox.label.textScale = 13f / 16f; uiCheckBox.label.text = (int)ImprovedPublicTransportMod.Settings.IntervalAggressionFactor == 0 ? Localization.Get("UNBUNCHING_DISABLED") : Localization.Get("UNBUNCHING_ENABLED"); uiCheckBox.label.relativePosition = new Vector3(22f, 2f); uiCheckBox.size = new Vector2(uiCheckBox.label.width + 22f, 16f); this.m_unbunching = uiCheckBox; UIPanel uiPanel7 = uiPanel2.AddUIComponent <UIPanel>(); string str7 = "Line"; uiPanel7.name = str7; int num28 = 13; uiPanel7.anchor = (UIAnchorStyle)num28; Vector2 vector2_5 = new Vector2(345f, 25f); uiPanel7.size = vector2_5; int num29 = 1; uiPanel7.autoLayout = num29 != 0; int num30 = 0; uiPanel7.autoLayoutDirection = (LayoutDirection)num30; RectOffset rectOffset6 = new RectOffset(0, 10, 0, 0); uiPanel7.autoLayoutPadding = rectOffset6; int num31 = 0; uiPanel7.autoLayoutStart = (LayoutStart)num31; int num32 = 1; uiPanel7.useCenter = num32 != 0; UILabel uiLabel7 = uiPanel7.AddUIComponent <UILabel>(); uiLabel7.name = "Line"; uiLabel7.anchor = UIAnchorStyle.Left | UIAnchorStyle.CenterVertical; uiLabel7.font = UIHelper.Font; uiLabel7.autoSize = true; uiLabel7.height = 25f; uiLabel7.textScale = 13f / 16f; uiLabel7.textColor = new Color32((byte)185, (byte)221, (byte)254, byte.MaxValue); uiLabel7.verticalAlignment = UIVerticalAlignment.Middle; uiLabel7.relativePosition = new Vector3(0.0f, 5f); this.m_Line = uiLabel7; UIButton button1 = UIHelper.CreateButton((UIComponent)uiPanel7); button1.name = "ModifyLine"; button1.autoSize = true; button1.textPadding = new RectOffset(10, 10, 4, 2); button1.anchor = UIAnchorStyle.Left | UIAnchorStyle.CenterVertical; button1.localeID = "VEHICLE_MODIFYLINE"; button1.textScale = 0.75f; button1.eventClick += new MouseEventHandler(this.OnModifyLineClick); UIPanel uiPanel8 = uiPanel2.AddUIComponent <UIPanel>(); string str8 = "Buttons"; uiPanel8.name = str8; int num33 = 13; uiPanel8.anchor = (UIAnchorStyle)num33; int num34 = 1; uiPanel8.autoLayout = num34 != 0; int num35 = 0; uiPanel8.autoLayoutDirection = (LayoutDirection)num35; RectOffset rectOffset7 = new RectOffset(0, 5, 0, 0); uiPanel8.autoLayoutPadding = rectOffset7; int num36 = 0; uiPanel8.autoLayoutStart = (LayoutStart)num36; Vector2 vector2_6 = new Vector2(345f, 32f); uiPanel8.size = vector2_6; UIButton button2 = UIHelper.CreateButton((UIComponent)uiPanel8); button2.name = "PreviousStop"; button2.textPadding = new RectOffset(10, 10, 4, 0); button2.text = Localization.Get("STOP_PANEL_PREVIOUS"); button2.tooltip = Localization.Get("STOP_PANEL_PREVIOUS_TOOLTIP"); button2.textScale = 0.75f; button2.size = new Vector2(110f, 32f); button2.wordWrap = true; button2.eventClick += new MouseEventHandler(this.OnPreviousStopClick); UIButton button3 = UIHelper.CreateButton((UIComponent)uiPanel8); button3.name = "DeleteStop"; button3.textPadding = new RectOffset(10, 10, 4, 0); button3.text = Localization.Get("STOP_PANEL_DELETE_STOP"); button3.tooltip = Localization.Get("STOP_PANEL_DELETE_STOP_TOOLTIP"); button3.isEnabled = false; button3.textScale = 0.75f; button3.size = new Vector2(110f, 32f); button3.wordWrap = true; button3.hoveredTextColor = (Color32)Color.red; button3.focusedTextColor = (Color32)Color.red; button3.pressedTextColor = (Color32)Color.red; button3.eventClick += new MouseEventHandler(this.OnDeleteStopClick); this.m_DeleteStop = button3; UIButton button4 = UIHelper.CreateButton((UIComponent)uiPanel8); button4.name = "NextStop"; button4.textPadding = new RectOffset(10, 10, 4, 0); button4.text = Localization.Get("STOP_PANEL_NEXT"); button4.tooltip = Localization.Get("STOP_PANEL_NEXT_TOOLTIP"); button4.textScale = 0.75f; button4.size = new Vector2(110f, 32f); button4.wordWrap = true; button4.eventClick += new MouseEventHandler(this.OnNextStopClick); }
public void ShowEquipTipCurrent (string suitName, List <string> suitAttr, List <string> attrs, List <string> jewels, List <string> slotIcons, string vocation, List <ButtonInfo> buttonList) { ReleaseInstance(); m_equipTipCurrent.SetActive(true); m_equipTip.transform.localPosition = right.localPosition; float gap = -12; float attrGap = 10; Transform root = transform.FindChild(m_widgetToFullName["EquipTipCurrentDetailList"]); //加载+排版 int i = 0; //属性 //添加套装名 if (suitName != "") { var _gap = gap; GetInstance("EquipTipSuitNameTitle.prefab", (gameObject) => { GameObject go = gameObject as GameObject; UILabel lable = go.transform.FindChild("EquipTipSuitName").GetComponent <UILabel>(); Vector3 scale = go.transform.localScale; Vector3 position = go.transform.localPosition; Vector3 angle = go.transform.localEulerAngles; go.transform.parent = root; go.transform.localScale = scale; go.transform.localEulerAngles = angle; go.transform.localPosition = new Vector3(0, _gap, 0); gos.Add(go); lable.text = suitName; } ); gap -= GAP + 22; //var _gap = gap; //GetInstance("EquipTipSuitName.prefab", //(gameObject) => //{ // GameObject go = gameObject as GameObject; // UILabel lable = go.transform.GetComponent<UILabel>(); // Vector3 scale = go.transform.localScale; // Vector3 position = go.transform.localPosition; // Vector3 angle = go.transform.localEulerAngles; // go.transform.parent = root; // go.transform.localScale = scale; // go.transform.localEulerAngles = angle; // go.transform.localPosition = new Vector3(position.x, originalY + _gap, position.z); // gos.Add(go); // lable.text = suitName; //} //); //gap -= GAP; } //添加套装属性 if (suitAttr != null) { for (i = 0; i < suitAttr.Count; i++) { var index = i; var _gap = gap; GetInstance("EquipTipSuitAttr.prefab", (gameObject) => { //PackageEquipInfoDiamonHole0Text GameObject go = gameObject as GameObject; UILabel lable = go.transform.GetComponent <UILabel>(); Vector3 scale = go.transform.localScale; Vector3 position = go.transform.localPosition; Vector3 angle = go.transform.localEulerAngles; go.transform.parent = root; go.transform.localScale = scale; go.transform.localEulerAngles = angle; go.transform.localPosition = new Vector3(0, _gap - (index * attrGap + 22), 0); gos.Add(go); lable.text = suitAttr[index]; } ); } if (suitAttr.Count > 0) { gap -= GAP + i * (attrGap + 22); } } for (i = 0; i < attrs.Count; i++) { var index = i; var _gap = gap; GetInstance("PackageEquipInfoAttr.prefab", (gameObject) => { //PackageEquipInfoDiamonHole0Text GameObject go = gameObject as GameObject; UILabel lable = go.transform.FindChild("PackageEquipInfoDiamonHole0Text").GetComponent <UILabel>(); Vector3 scale = go.transform.localScale; Vector3 position = go.transform.localPosition; Vector3 angle = go.transform.localEulerAngles; go.transform.parent = root; go.transform.localScale = scale; go.transform.localEulerAngles = angle; go.transform.localPosition = new Vector3(position.x, _gap - index * (attrGap + 22), position.z); gos.Add(go); lable.text = attrs[index]; } ); } gap -= GAP + i * (attrGap + 22); //宝石 for (i = 0; i < jewels.Count; i++) { float _gap = gap; var index = i; GetInstance("PackageEquipInfoDiamon.prefab", (gameObject) => { //PackageEquipInfoDiamonHole0Text GameObject go = gameObject as GameObject; UILabel lable = go.transform.FindChild("PackageEquipInfoDiamonHole12Text").GetComponent <UILabel>(); UISprite sprite = go.transform.FindChild("PackageEquipInfoDiamonHole12FG").GetComponent <UISprite>(); //if (lable.text.Equals(LanguageData.GetContent(910))) //{ // sprite.gameObject.SetActive(false); //} Vector3 scale = go.transform.localScale; Vector3 position = go.transform.localPosition; Vector3 angle = go.transform.localEulerAngles; go.transform.parent = root; go.transform.localScale = scale; go.transform.localEulerAngles = angle; go.transform.localPosition = new Vector3(0, _gap + -index * (attrGap + 22), 0); gos.Add(go); lable.text = jewels[index]; sprite.spriteName = slotIcons[index]; } ); } gap -= GAP + i * (attrGap + 22); //需求等级等 Transform detail3 = m_equipTipDetailCurrent.transform; detail3.gameObject.SetActive(true); detail3.localPosition = new Vector3(0, gap, 0); m_equipDetailNeedJobCurrent.GetComponent <UILabel>().text = LanguageData.GetContent(912, vocation); gap -= 56; //show float minY; minY = -gap + 3 - m_equipTipCameraAreaCurrent.localScale.y; minY = minY > 0 ? minY : 0; m_equipTipCameraCurrent.MINY = m_equipTipCameraPosBeginCurrent.localPosition.y - minY; m_equipTipCameraCurrent.transform.localPosition = m_equipTipCameraPosBeginCurrent.localPosition; InitButtonList(buttonList); this.gameObject.SetActive(true); }
/// <summary> /// Select the specified label. /// </summary> void Select(UILabel lbl, bool instant) { Highlight(lbl, instant); }
/// <summary> /// Initializes a new instance of the <see cref="T:SampleBrowser.LoadMoreSample"/> class. /// </summary> public LoadMoreSample() { carouselScrollview = new UIScrollView(); alertWindow = new UIAlertView(); alertWindow.AddButton("OK"); carouselViewModel = new CarouselViewModel(); LoadMoreLayout = new UIView(); LoadMoreLayout.BackgroundColor = UIColor.FromRGB(249, 249, 249); carouselScrollview.BackgroundColor = UIColor.FromRGB(249, 249, 249); applicationLabel = new UILabel(); applicationLabel.Text = "Application"; applicationLabel.TextColor = UIColor.FromRGBA(nfloat.Parse((51 / 255.0).ToString()), nfloat.Parse((51 / 255.0).ToString()), nfloat.Parse((51 / 255.0).ToString()), nfloat.Parse("0.9764705882352941")); applicationLabel.Font = UIFont.FromName("Helvetica", 18f); applicationCarousel = new SFCarousel(); applicationCarousel.ItemWidth = 150; applicationCarousel.ItemHeight = 150; applicationCarousel.AllowLoadMore = true; applicationCarousel.LoadMoreItemsCount = 4; UILabel loadmore2 = new UILabel() { TextColor = UIColor.Black, Text = "Load More...", Font = UIFont.FromName("Helvetica-Bold", 13f), TextAlignment = UITextAlignment.Center }; loadmore2.Frame = new CoreGraphics.CGRect(12, 61, 150, 17); UIView loadView2 = new UIView(); loadView2.BackgroundColor = UIColor.FromRGB(255, 255, 255); loadView2.AddSubview(loadmore2); applicationCarousel.LoadMoreView = loadView2; applicationCarousel.ViewMode = SFCarouselViewMode.SFCarouselViewModeLinear; applicationCarousel.ItemsSource = carouselViewModel.ApplicationCollection; applicationCarousel.ItemSpacing = 15; applicationCarousel.DrawView += DrawAdapterView; foodLabel = new UILabel(); foodLabel.Text = "Food"; foodLabel.TextColor = UIColor.FromRGBA(nfloat.Parse((51 / 255.0).ToString()), nfloat.Parse((51 / 255.0).ToString()), nfloat.Parse((51 / 255.0).ToString()), nfloat.Parse("0.9764705882352941")); foodLabel.Font = UIFont.FromName("Helvetica", 18f); foodCarousel = new SFCarousel(); foodCarousel.ItemWidth = 150; foodCarousel.ItemHeight = 150; foodCarousel.AllowLoadMore = true; foodCarousel.LoadMoreItemsCount = 4; UILabel loadmore = new UILabel() { TextColor = UIColor.Black, Text = "Load More...", Font = UIFont.FromName("Helvetica-Bold", 13f), TextAlignment = UITextAlignment.Center }; UIView loadView = new UIView(); loadmore.Frame = new CoreGraphics.CGRect(12, 61, 150, 17); loadView.BackgroundColor = UIColor.FromRGB(255, 255, 255); loadView.AddSubview(loadmore); foodCarousel.LoadMoreView = loadView; foodCarousel.ItemSpacing = 15; foodCarousel.ViewMode = SFCarouselViewMode.SFCarouselViewModeLinear; foodCarousel.ItemsSource = carouselViewModel.TransportCollection; foodCarousel.DrawView += DrawFoodAdapterView; LoadMoreLayout.AddSubview(applicationLabel); LoadMoreLayout.AddSubview(applicationCarousel); LoadMoreLayout.AddSubview(foodLabel); LoadMoreLayout.AddSubview(foodCarousel); bankingLabel = new UILabel(); bankingLabel.Text = "Banking"; bankingLabel.TextColor = UIColor.FromRGBA(nfloat.Parse((51 / 255.0).ToString()), nfloat.Parse((51 / 255.0).ToString()), nfloat.Parse((51 / 255.0).ToString()), nfloat.Parse("0.9764705882352941")); bankingLabel.Font = UIFont.FromName("Helvetica", 18f); bankCarousel = new SFCarousel(); bankCarousel.ItemWidth = 150; bankCarousel.ItemHeight = 150; bankCarousel.AllowLoadMore = true; bankCarousel.LoadMoreItemsCount = 4; UILabel loadmore1 = new UILabel() { TextColor = UIColor.Black, Text = "Load More...", Font = UIFont.FromName("Helvetica-Bold", 13f), TextAlignment = UITextAlignment.Center }; UIView loadView1 = new UIView(); loadmore1.Frame = new CoreGraphics.CGRect(12, 61, 150, 17); loadView1.BackgroundColor = UIColor.FromRGB(255, 255, 255); loadView1.AddSubview(loadmore1); bankCarousel.LoadMoreView = loadView1; bankCarousel.ItemSpacing = 15; bankCarousel.ViewMode = SFCarouselViewMode.SFCarouselViewModeLinear; bankCarousel.ItemsSource = carouselViewModel.OfficeCollection; bankCarousel.DrawView += DrawBankAdapterView; LoadMoreLayout.AddSubview(applicationLabel); LoadMoreLayout.AddSubview(applicationCarousel); LoadMoreLayout.AddSubview(foodLabel); LoadMoreLayout.AddSubview(foodCarousel); LoadMoreLayout.AddSubview(bankingLabel); LoadMoreLayout.AddSubview(bankCarousel); carouselScrollview.AddSubview(LoadMoreLayout); this.AddSubview(carouselScrollview); }
public static UIPanel CreateStatisticRow(UIComponent parent, out UILabel label1, out UILabel label2, out UILabel label3, out UILabel label4, bool isCaptionRow = false) { float width = parent.width; float y = 15f; if (isCaptionRow) { y = 30f; } UIPanel uiPanel = parent.AddUIComponent <UIPanel>(); uiPanel.anchor = UIAnchorStyle.Top | UIAnchorStyle.Left | UIAnchorStyle.Right; uiPanel.autoLayout = true; uiPanel.autoLayoutDirection = LayoutDirection.Horizontal; uiPanel.autoLayoutPadding = new RectOffset(0, 1, 0, 0); uiPanel.autoLayoutStart = LayoutStart.TopLeft; uiPanel.size = new Vector2(width, y); label1 = uiPanel.AddUIComponent <UILabel>(); label1.font = UIHelper.Font; label1.autoSize = false; label1.size = new Vector2((float)(((double)width - 3.0) * 0.340000003576279), y); label1.textScale = 13f / 16f; label1.textColor = new Color32((byte)185, (byte)221, (byte)254, byte.MaxValue); label1.wordWrap = true; label2 = uiPanel.AddUIComponent <UILabel>(); label2.font = UIHelper.Font; label2.autoSize = false; label2.size = new Vector2((float)(((double)width - 3.0) * 0.219999998807907), y); label2.textScale = 13f / 16f; label2.textColor = new Color32((byte)185, (byte)221, (byte)254, byte.MaxValue); label2.textAlignment = UIHorizontalAlignment.Right; label2.wordWrap = true; label3 = uiPanel.AddUIComponent <UILabel>(); label3.font = UIHelper.Font; label3.autoSize = false; label3.size = new Vector2((float)(((double)width - 3.0) * 0.219999998807907), y); label3.textScale = 13f / 16f; label3.textColor = new Color32((byte)185, (byte)221, (byte)254, byte.MaxValue); label3.textAlignment = UIHorizontalAlignment.Right; label3.wordWrap = true; label4 = uiPanel.AddUIComponent <UILabel>(); label4.font = UIHelper.Font; label4.autoSize = false; label4.size = new Vector2((float)(((double)width - 3.0) * 0.219999998807907), y); label4.textScale = 13f / 16f; label4.textColor = new Color32((byte)185, (byte)221, (byte)254, byte.MaxValue); label4.textAlignment = UIHorizontalAlignment.Right; label4.wordWrap = true; return(uiPanel); }
void Awake() { label = GetComponent<UILabel>(); }
public override void LoadView() { // Create the views. View = new UIView { BackgroundColor = ApplicationTheme.BackgroundColor }; _myMapView = new MapView(); _myMapView.TranslatesAutoresizingMaskIntoConstraints = false; _layerList = new UITableView(); _layerList.TranslatesAutoresizingMaskIntoConstraints = false; _layerList.RowHeight = 40; UILabel helpLabel = new UILabel { Text = "Select layers for display.", AdjustsFontSizeToFitWidth = true, TextAlignment = UITextAlignment.Center, BackgroundColor = UIColor.FromWhiteAlpha(0, .6f), TextColor = UIColor.White, Lines = 1, TranslatesAutoresizingMaskIntoConstraints = false }; // Add the views. View.AddSubviews(_myMapView, _layerList, helpLabel); // Lay out the views. NSLayoutConstraint.ActivateConstraints(new[] { helpLabel.LeadingAnchor.ConstraintEqualTo(_myMapView.LeadingAnchor), helpLabel.TrailingAnchor.ConstraintEqualTo(_myMapView.TrailingAnchor), helpLabel.TopAnchor.ConstraintEqualTo(_myMapView.TopAnchor), helpLabel.HeightAnchor.ConstraintEqualTo(40), }); _portraitConstraints = new[] { _layerList.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor), _layerList.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor), _layerList.TopAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TopAnchor), _layerList.HeightAnchor.ConstraintEqualTo(_layerList.RowHeight * 4), _myMapView.TopAnchor.ConstraintEqualTo(_layerList.BottomAnchor), _myMapView.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor), _myMapView.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor), _myMapView.BottomAnchor.ConstraintEqualTo(View.BottomAnchor) }; _landscapeConstraints = new[] { _layerList.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor), _layerList.TopAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TopAnchor), _layerList.BottomAnchor.ConstraintEqualTo(View.BottomAnchor), _layerList.TrailingAnchor.ConstraintEqualTo(View.CenterXAnchor), _myMapView.LeadingAnchor.ConstraintEqualTo(_layerList.TrailingAnchor), _myMapView.TopAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TopAnchor), _myMapView.BottomAnchor.ConstraintEqualTo(View.BottomAnchor), _myMapView.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor) }; SetLayoutOrientation(); }