public override void ViewDidLayoutSubviews() { base.ViewDidLayoutSubviews(); // force the view to scroll to the top LicenseTextView.SetContentOffset(CGPoint.Empty, false); }
public override void ViewDidLoad() { base.ViewDidLoad(); NSMutableAttributedString content = new NSMutableAttributedString(); bool first = true; string interEntryLinebreaks = ""; for (int i = 0; i < LinesBetweenEntries; i++) { interEntryLinebreaks += Environment.NewLine; } foreach (var licenseStringKey in Constants.LicenseStringKeys) { // Add the desired amout of linebreaks between entries, but not before first entry if (first) { first = false; } else { content.Append(new NSAttributedString(interEntryLinebreaks)); } // Construct and add the entry var title = NSBundle.MainBundle.LocalizedString(licenseStringKey + "_title_text", ""); var body = NSBundle.MainBundle.LocalizedString(licenseStringKey + "_body_text", ""); content.Append(CreateEntry(title, body)); } LicenseTextView.AttributedText = content; LicenseTextView.FlashScrollIndicators(); }