uitextview

Keyboard events called before UITextView delegate events

。_饼干妹妹 提交于 2021-02-10 05:30:52
问题 I have a UITableView with UITextViews and UITextFields on it's cells. As obvious the keyboard overlaps the lower cells and you cannot see what you are typing. So I want to scroll the tableview to get the field visible. I wrote the code the iOS docs recommended: https://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html BUT the keyboard event callback keyboardWillShow: is called before the UITextView edit

get font-weight of an uitextview

北城以北 提交于 2021-02-08 08:35:17
问题 I want to resize the font-size in some UITextViews. That works fine with an outlet collection and this code: for (UITextView *view in self.viewsToResize) { if ([view respondsToSelector:@selector(setFont:)]) { [view setFont:[UIFont systemFontOfSize:view.font.pointSize + 5]]; } } But my problem is, that not every textView uses the systemFont in normal weight, some of them are in bold weight. Is it possible to get the font-weight? With a po view.font in the debug area I can see everything I need

UITextView UITextViewTextDidChangeNotification not being called on programmatic change of the text

五迷三道 提交于 2021-02-08 03:38:30
问题 I call this in the init of a custom UITextView: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textChanged:) name:UITextViewTextDidChangeNotification object:self]; The method textChanged is not called when I programmatically set textView.text = @"" Any Ideas on what I am doing wrong? 回答1: Your shouldn't pass self to the last parameter, this parameter is notificationSender, it means that you just want to observer the notifications sent by self . Observer like this: [

UITextView with voiceover

时光毁灭记忆、已成空白 提交于 2021-02-07 11:20:17
问题 Here is my very simple code for creating a UITextView . UITextView *textView = [[UITextView alloc] initWithFrame:self.view.bounds]; textView.editable = NO; textView.text = @"Using iOS 3.0 and later, VoiceOver is available to help users with visual impairments use their iOS-based devices. The UI Accessibility programming interface, introduced in iOS 3.0, helps developers make their applications accessible to VoiceOver users. Briefly, VoiceOver describes an application’s user interface and

Gradient effect in UITextView iPhone?

佐手、 提交于 2021-02-07 10:31:13
问题 I am working on a project where I need to implement center gradient in UITextView. It must be something like attached image. I cannot use any image at upper of UITextView because I want user interaction in UITextView. Please provide your suggestions. Thanks 回答1: If you apply CAGRradient Layer on UITextView and set [txtView.layer setMask:gradient] this will create problem while scrolling means the gradient layer will scroll. To overcome from this problem you must use a UiView working as a

Gradient effect in UITextView iPhone?

跟風遠走 提交于 2021-02-07 10:30:28
问题 I am working on a project where I need to implement center gradient in UITextView. It must be something like attached image. I cannot use any image at upper of UITextView because I want user interaction in UITextView. Please provide your suggestions. Thanks 回答1: If you apply CAGRradient Layer on UITextView and set [txtView.layer setMask:gradient] this will create problem while scrolling means the gradient layer will scroll. To overcome from this problem you must use a UiView working as a

How to know which line of a TextView the user has tapped on

杀马特。学长 韩版系。学妹 提交于 2021-01-28 07:09:31
问题 I'm building an app that has a multi-line text editor (UITextView in UIKit, and TextEditor in SwiftUI). When the user tap on any line of the multi-line text, I should know which line is that, so I can print that line or do any other task. Is there a way to know which line of a UITextView the user has tapped on (using textViewDidChangeSelection delegate function or anything else)? I was thinking of storing the whole text in an Array (each line is an element), and updating the array

In Xcode how to add Multiple Paragraphs with Bold Headings?

自作多情 提交于 2021-01-28 07:07:52
问题 In My Application I have a Information Screen In that i am displaying related information. I have a Total 4 pages Text. In the Text There are Several Paragraphs with Bold headings and Some Bullet points are there For Example : My Text is looks like this : This is Heading This is Paragraph Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and

ios - Replace/delete characters [• ] in UITextView on Enter

好久不见. 提交于 2021-01-28 05:17:30
问题 I have a UITextView with a custom NSTextStorage, where I add a list bullet, after each Enter, if the prior line starts with a list bullet. When a user Enter and there is only a list bullet in the beginning of the line where the cursor is, I remove the list bullet and stay on that line. The first function works as expected. But I have a hard time figuring out how to remove the list bullet. if prefix.isEmpty { let text = string.split(separator: "\n") let next = NSMakeRange(textView

Trigger button to change text in UITextView in swift3 xcode 8 ios 10

青春壹個敷衍的年華 提交于 2021-01-27 12:23:36
问题 I'm new to xcode and am stuck on this problem, because after trying several sample code examples online, nothing works. Could you help me figure out what the problem is? My code below: import UIKit class ViewController: UIViewController { @IBOutlet weak var Writingboard: UITextView! @IBOutlet weak var Talkbutton: UIButton! @IBAction func TalkbuttonTapped(_ sender: AnyObject){ Talkbutton.setTitle("Tap to Stop", for: .normal) Writingboard.text="talking" } override func viewDidLoad() { super