public static ContentSize ( UITextView textView ) : float | ||
textView | UITextView | |
리턴 | float |
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); var nonEmptyCommentsSection = verse.Comments.Length != 0; if (nonEmptyCommentsSection) { blackLine.Hidden = false; commentsArea.Hidden = false; commentsArea.Text = verse.Comments; commentsArea.Frame = new RectangleF(commentsArea.Frame.X, commentsArea.Frame.Y, commentsArea.Frame.Width, InterfaceHelper.ContentSize(commentsArea.Text, contentArea.Frame.Width, contentArea.Font)); shareButton.Frame = new RectangleF(shareButton.Frame.X, commentsArea.Frame.Bottom + 22f, shareButton.Frame.Width, shareButton.Frame.Height); } else { blackLine.Hidden = true; commentsArea.Hidden = true; shareButton.Frame = new RectangleF(shareButton.Frame.X, contentArea.Frame.Bottom + 22f, shareButton.Frame.Width, shareButton.Frame.Height); } backingBackButton.TouchUpInside += HandleBackButtonTapped; backingEditButton.TouchUpInside += HandleEditButtonTapped; shareButton.TouchUpInside += HandleShareTapped; copyrightButton.TouchUpInside += HandleCopyrightButtonTapped; }
private void SetupUI() { ScrollView = new UIScrollView() { BackgroundColor = UIColor.FromPatternImage(Images.TableViewBackground), Frame = new RectangleF(0, 0, View.Bounds.Width, View.Bounds.Height), PagingEnabled = false, ScrollEnabled = true }; View.Add(ScrollView); TopBarArea = new UITextField() { BackgroundColor = UIColor.White, Enabled = false, Font = FontConstants.SourceSansProRegular(13), Frame = new RectangleF(14f, 22f, 294f, 32f), LeftView = new UIImageView(Images.TimeIcon), LeftViewMode = UITextFieldViewMode.Always, Text = Prayer.Timestamp.ToShortDateString(), TextAlignment = UITextAlignment.Left, VerticalAlignment = UIControlContentVerticalAlignment.Center }; ContentArea = new UILabel() { BackgroundColor = UIColor.White, Font = FontConstants.SourceSansProRegular(13), Frame = new RectangleF(14f, 48f, 294f, 10f), LineBreakMode = UILineBreakMode.TailTruncation, Lines = 0, Text = Prayer.Content, TextAlignment = UITextAlignment.Left }; ScrollView.Add(ContentArea); ContentArea.Frame = new RectangleF(14f, 52f, 294f, InterfaceHelper.ContentSize(ContentArea.Text, ContentArea.Frame.Width, ContentArea.Font)); var height = ContentArea.Bounds.Height + 79f; ShareButton = new UIButton() { Frame = new RectangleF(33.5f, height, 253f, 33f) }; ShareButton.SetBackgroundImage(Images.ShareButton, UIControlState.Normal); ShareButton.AddTarget(HandleShareTapped, UIControlEvent.TouchUpInside); ScrollView.Add(TopBarArea); ScrollView.Add(ShareButton); // ShareButton + NavBar + TabBar + (2 * 22f) var contentSize = ShareButton.Frame.Y + 170; ScrollView.ContentSize = new SizeF(320f, contentSize); }
public override void ViewDidAppear(bool animated) { base.ViewDidAppear(animated); TopBarArea.Text = Prayer.Timestamp.ToShortDateString(); ContentArea.Text = Prayer.Content; ContentArea.Frame = new RectangleF(14f, 52f, 294f, InterfaceHelper.ContentSize(ContentArea.Text, ContentArea.Frame.Width, ContentArea.Font)); ShareButton.Frame = new RectangleF(ShareButton.Frame.X, ContentArea.Frame.Height + 79f, ShareButton.Frame.Width, ShareButton.Frame.Height); }
public override void ViewDidAppear(bool animated) { base.ViewDidAppear(animated); if (verse.Comments.Length != 0) { BlackLine.Hidden = false; CommentsArea.Hidden = false; CommentsArea.Text = verse.Comments; CommentsArea.Frame = new RectangleF(CommentsArea.Frame.X, CommentsArea.Frame.Y, CommentsArea.Frame.Width, InterfaceHelper.ContentSize(CommentsArea.Text, ContentArea.Frame.Width, ContentArea.Font)); ShareButton.Frame = new RectangleF(ShareButton.Frame.X, CommentsArea.Frame.Bottom + 22f, ShareButton.Frame.Width, ShareButton.Frame.Height); ToMemorizeButton.Frame = new RectangleF(ToMemorizeButton.Frame.X, ShareButton.Frame.Bottom + 10f, ToMemorizeButton.Frame.Width, ToMemorizeButton.Frame.Height); MemorizedButton.Frame = new RectangleF(MemorizedButton.Frame.X, ToMemorizeButton.Frame.Bottom + 10f, MemorizedButton.Frame.Width, MemorizedButton.Frame.Height); } }
private void SetupUI() { View.BackgroundColor = UIColor.White; scrollView = new UIScrollView { BackgroundColor = UIColor.Clear, Frame = new RectangleF(0, 0, View.Bounds.Width, View.Bounds.Height), PagingEnabled = false, ScrollEnabled = true }; View.Add(scrollView); contentArea = new UILabel { BackgroundColor = UIColor.Clear, Font = FontConstants.SourceSansProRegular(15), Frame = new RectangleF(14f, 35f, 294f, 10f), LineBreakMode = UILineBreakMode.TailTruncation, Lines = 0, Text = verse.Content, TextAlignment = UITextAlignment.Left }; scrollView.Add(contentArea); contentArea.Frame = new RectangleF(14f, 35f, 294f, InterfaceHelper.ContentSize(contentArea.Text, contentArea.Frame.Width, contentArea.Font)); var height = contentArea.Bounds.Height + 45f; blackLine = new UIView { BackgroundColor = UIColor.FromPatternImage(UIImage.FromFile(Images.BlackLine)), Frame = new RectangleF(24, height, 284f, 1f) }; scrollView.Add(blackLine); height = contentArea.Frame.Height + blackLine.Frame.Height + 50f; commentsArea = new UILabel { BackgroundColor = UIColor.Clear, Font = FontConstants.SourceSansProRegular(15), Frame = new RectangleF(14f, height, 294f, 10f), LineBreakMode = UILineBreakMode.TailTruncation, Lines = 0, Text = verse.Comments, TextAlignment = UITextAlignment.Left }; scrollView.Add(commentsArea); if (verse.Comments.Length != 0) { commentsArea.Frame = new RectangleF(14f, height, 294f, InterfaceHelper.ContentSize(commentsArea.Text, contentArea.Frame.Width, contentArea.Font)); } else { commentsArea.Hidden = true; blackLine.Hidden = true; } height = contentArea.Bounds.Height + 45; shareButton = new UIButton { Frame = new RectangleF(33.5f, height, 253f, 33f) }; shareButton.SetBackgroundImage(UIImage.FromFile(Images.ShareButton), UIControlState.Normal); copyrightButton = new UIButton { Enabled = true, Frame = new RectangleF(282, 5, 25, 25), UserInteractionEnabled = true }; copyrightButton.SetBackgroundImage(UIImage.FromFile(Images.CopyrightButton), UIControlState.Normal); scrollView.Add(shareButton); scrollView.Add(copyrightButton); var contentSize = shareButton.Frame.Y + 170; scrollView.ContentSize = new SizeF(320f, contentSize); }
private void SetupUI() { View.BackgroundColor = UIColor.FromPatternImage(Images.TableViewBackground); ScrollView = new UIScrollView { BackgroundColor = UIColor.FromPatternImage(Images.TableViewBackground), Frame = new RectangleF(0, 0, View.Bounds.Width, View.Bounds.Height), PagingEnabled = false, ScrollEnabled = true }; View.Add(ScrollView); TopBarArea = new UITextField { BackgroundColor = UIColor.White, Enabled = false, UserInteractionEnabled = false, Font = FontConstants.SourceSansProRegular(13), Frame = new RectangleF(14f, 22f, 294f, 32f), LeftView = new UIImageView(Images.TimeIcon), LeftViewMode = UITextFieldViewMode.Always, Text = verse.Timestamp.ToShortDateString(), TextAlignment = UITextAlignment.Left, VerticalAlignment = UIControlContentVerticalAlignment.Center }; ContentArea = new UILabel { BackgroundColor = UIColor.White, Font = FontConstants.SourceSansProRegular(13), Frame = new RectangleF(14f, 48f, 294f, 10f), LineBreakMode = UILineBreakMode.TailTruncation, Lines = 0, Text = verse.Content, TextAlignment = UITextAlignment.Left }; ScrollView.Add(ContentArea); ContentArea.Frame = new RectangleF(14f, 52f, 294f, InterfaceHelper.ContentSize(ContentArea.Text, ContentArea.Frame.Width, ContentArea.Font)); var height = ContentArea.Bounds.Height + 50f; BlackLine = new UIView { BackgroundColor = UIColor.FromPatternImage(Images.BlackLine), Frame = new RectangleF(24, height, 284f, 1f) }; ScrollView.Add(BlackLine); height = ContentArea.Frame.Height + BlackLine.Frame.Height + 50f; // BlackLine.Frame.Height + 50f; CommentsArea = new UILabel { BackgroundColor = UIColor.White, Font = FontConstants.SourceSansProRegular(13), Frame = new RectangleF(14f, height, 294f, 10f), LineBreakMode = UILineBreakMode.TailTruncation, Lines = 0, Text = verse.Comments, TextAlignment = UITextAlignment.Left }; ScrollView.Add(CommentsArea); if (verse.Comments.Length != 0) { CommentsArea.Frame = new RectangleF(14f, height, 294f, InterfaceHelper.ContentSize(CommentsArea.Text, ContentArea.Frame.Width, ContentArea.Font)); } else { CommentsArea.Hidden = true; BlackLine.Hidden = true; } height = CommentsArea.Frame.Bottom + 22f; ShareButton = new UIButton { Frame = new RectangleF(33.5f, height, 253f, 33f) }; ShareButton.SetBackgroundImage(Images.ShareButton, UIControlState.Normal); ShareButton.AddTarget(HandleShareTapped, UIControlEvent.TouchUpInside); var toMemorizeHeight = ShareButton.Frame.Bottom + 10f; ToMemorizeButton = new UIButton { Frame = new RectangleF(33.5f, toMemorizeHeight, 253f, 33f) }; ToMemorizeButton.AddTarget(HandleToMemorizeTapped, UIControlEvent.TouchUpInside); var memorizable = verse.Memorizable; if (memorizable) { ToMemorizeButton.SetBackgroundImage(Images.ToMemorizeGreenButton, UIControlState.Normal); } else { ToMemorizeButton.SetBackgroundImage(Images.ToMemorizeRedButton, UIControlState.Normal); } var memorizedHeight = ToMemorizeButton.Frame.Bottom + 10f; MemorizedButton = new UIButton { Frame = new RectangleF(33.5f, memorizedHeight, 253f, 33f) }; MemorizedButton.AddTarget(HandleMemorizedTapped, UIControlEvent.TouchUpInside); var memorized = verse.Memorized; if (memorized) { MemorizedButton.SetBackgroundImage(Images.MemorizedGreenButton, UIControlState.Normal); } else { MemorizedButton.SetBackgroundImage(Images.MemorizedRedButton, UIControlState.Normal); } if (!verse.Memorizable) { MemorizedButton.Hidden = true; } CopyrightButton = new UIButton { Enabled = true, Frame = new RectangleF(282, 22, 25, 25), UserInteractionEnabled = true }; CopyrightButton.SetBackgroundImage(Images.CopyrightButton, UIControlState.Normal); CopyrightButton.AddTarget(HandleCopyrightButtonTapped, UIControlEvent.TouchUpInside); ScrollView.Add(TopBarArea); ScrollView.Add(ShareButton); ScrollView.Add(ToMemorizeButton); ScrollView.Add(MemorizedButton); ScrollView.Add(CopyrightButton); var contentSize = MemorizedButton.Frame.Y + 170; ScrollView.ContentSize = new SizeF(320f, contentSize); }