uitextview
Detect Start and Stop Editing UITextView
http://developer.apple.com/library/ios/#documentation/uikit/reference/UITextViewDelegate_Protocol/Reference/UITextViewDelegate.html#//apple_ref/occ/intf/UITextViewDelegate Here you can find several useful methods to investigate: textViewDidBeginEditing: textViewDidEndEditing: Moreover to leave UITextView you often should implement action that calls [yourTextView resignFirstResponder]; Objective-C example //you may specify UITextViewDelegate protocol in .h file interface, but it’s better not to expose it if not necessary @interface ExampleViewController()<UITextViewDelegate> @end @implementation ExampleViewController – (void)viewDidLoad { [super … Read more
UITextView font is nil
Try checking the “selectable” checkbox for this UITextView in Interface Builder. It’s in the Attributes Inspector. Per @VahramDodoryan’s comment below, you can then set selectable to false if you don’t want to support selection. I can’t explain why this works, but it’s probably a UIKit bug. I had an IBOutlet to a UITextView whose font … Read more
UITextView inside UIScrollView with AutoLayout
After a few days of research and getting my hands dirty with UIScrollView + UITextView + Auto Layout, I successfully got a fully working UIScrollView. I want to share my solution just in case someone might stuck on the same situation. Add UIScrollView inside the main view in Storyboard Add UIView inside the UIScrollView Add … Read more
Scroll UITextView To Bottom
You can use the following code if you are talking about UITextView: -(void)scrollTextViewToBottom:(UITextView *)textView { if(textView.text.length > 0 ) { NSRange bottom = NSMakeRange(textView.text.length -1, 1); [textView scrollRangeToVisible:bottom]; } } SWIFT 4: func scrollTextViewToBottom(textView: UITextView) { if textView.text.count > 0 { let location = textView.text.count – 1 let bottom = NSMakeRange(location, 1) textView.scrollRangeToVisible(bottom) } }
UITextView background image
You can have an UIImageView containing the background image and the UITextView as siblings, then in Interface Builder move the text view to overlap the image view (or add them both to the same parent view if doing it programmatically). You also need to make sure that text view is not opaque and give it … Read more
Text views and image view disappearing from view controller in Xcode 6.1 storyboard
Another workaround is to add constraints to the layout Before resizing of any views. (add missing constraints e.g.). The bug only seems to occur when there are no constraints available. I have reported the bug to Apple with Bugreporter. Edit: So, at least it seems that Apple Bugreporter is working. The problem is fixed in … Read more
UIView doesn’t resize to full screen when hiding the nav bar & tab bar
I had this exact problem where I was animating the tab bar and navigation bar off the bottom and top of the screen respectively, leaving a 49px high white space where the tab bar was. It turns out that the reason my new “fullscreen” view wasn’t actually filling the space was because I was adding … Read more