uitextview

Disable UITextView scrolling the containing view?

馋奶兔 提交于 2020-01-01 19:14:41
问题 I've got a UITextView inside a UIScrollView (specifically, the text view is in a UITableViewCell in a table). When I type in the text view and hit return to make some new lines (and the text in the text view becomes too long for it to contain vertically), it scrolls both the text view itself (which is okay) and the table/table cell that contains it (which I would like to prevent) . Is there some way to prevent this behaviour? The UITableView has scrollEnabled set to NO, yet the UITextView

UITextView like iPhone Notes application

我怕爱的太早我们不能终老 提交于 2020-01-01 17:04:16
问题 I am trying to recreate the Notes application. So far I got the following: textView = [[UITextView alloc] initWithFrame:CGRectMake(25.0, 30.0, 295.0, 214.0)]; textView.delegate = self; textView.backgroundColor = [UIColor clearColor]; textView.font = [UIFont fontWithName:@"MarkerFelt-Thin" size:19.0]; [self.view addSubview:textView]; The thing I dont know is how they were able to put the date on top like a header (it is within the UIScrollView that is obvious). Also under every text there is a

UITextView like iPhone Notes application

百般思念 提交于 2020-01-01 17:03:44
问题 I am trying to recreate the Notes application. So far I got the following: textView = [[UITextView alloc] initWithFrame:CGRectMake(25.0, 30.0, 295.0, 214.0)]; textView.delegate = self; textView.backgroundColor = [UIColor clearColor]; textView.font = [UIFont fontWithName:@"MarkerFelt-Thin" size:19.0]; [self.view addSubview:textView]; The thing I dont know is how they were able to put the date on top like a header (it is within the UIScrollView that is obvious). Also under every text there is a

UITextView like iPhone Notes application

萝らか妹 提交于 2020-01-01 17:03:06
问题 I am trying to recreate the Notes application. So far I got the following: textView = [[UITextView alloc] initWithFrame:CGRectMake(25.0, 30.0, 295.0, 214.0)]; textView.delegate = self; textView.backgroundColor = [UIColor clearColor]; textView.font = [UIFont fontWithName:@"MarkerFelt-Thin" size:19.0]; [self.view addSubview:textView]; The thing I dont know is how they were able to put the date on top like a header (it is within the UIScrollView that is obvious). Also under every text there is a

UITextView with “Done” button *and* “Return” key?

非 Y 不嫁゛ 提交于 2020-01-01 09:31:33
问题 I use a UITextView for multiline text entry in my iPhone app, and I have set the "Return" key to display "Done." I've also set up the return key to disable first responder status, so that hitting "done" actually exits the UITextView. However, I also want to enable users to be able to enter multiline text into the UITextView, i.e. to be able to use the "Return" key. Is there any way to make this work on the iPhone/iPad's UI? 回答1: It'll be time consuming but you could create your own keyboard

UITextView with “Done” button *and* “Return” key?

霸气de小男生 提交于 2020-01-01 09:31:30
问题 I use a UITextView for multiline text entry in my iPhone app, and I have set the "Return" key to display "Done." I've also set up the return key to disable first responder status, so that hitting "done" actually exits the UITextView. However, I also want to enable users to be able to enter multiline text into the UITextView, i.e. to be able to use the "Return" key. Is there any way to make this work on the iPhone/iPad's UI? 回答1: It'll be time consuming but you could create your own keyboard

UItextView background colours Linespacing area too

半城伤御伤魂 提交于 2020-01-01 07:17:21
问题 I am trying to replicate the text highlight (Not Search Text Highlight) in my UIText View. But I am Stuck with the colouring in the linespacing as well. How Can I rectify this ? Current situation: Desired Outcome: I have added the following attributes to my UiTextview's Attributed Text For Paragraph Line Spacing I have used the following let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.lineSpacing = 10 For Other Attributes I have used the following verseAttributes :

Why does NSString sizeWithFont: return the wrong size?

喜你入骨 提交于 2020-01-01 06:52:05
问题 I need to work out the height of a UITextView from the top down to the cursor. I am trimming the text it contains (so it only goes up to the cursor) and then using NSString's sizeWithFont:constrainedToSize:lineBreakMode: method to work out the height, like so: NSRange range; range.location = noteTextView.selectedRange.location; range.length = noteTextView.text.length - range.location; NSString *string = [noteTextView.text stringByReplacingCharactersInRange:range withString:@""]; CGSize size =

iOS7 UITextView set NSLinkAttributeName attribute but can not click

跟風遠走 提交于 2020-01-01 06:46:30
问题 @interface ViewController ()<UITextViewDelegate> - (void)viewDidLoad { [super viewDidLoad]; NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"www.google.com"]; NSDictionary *linkDic = @{ NSLinkAttributeName : [NSURL URLWithString:@"http://www.google.com"] }; [str setAttributes:linkDic range:[[str string] rangeOfString:@"www.google.com"]]; _textView.attributedText = str; } - (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:

UITextView resign first responder on 'Done'

笑着哭i 提交于 2019-12-31 21:32:47
问题 I have been searching around the web for about an hour now, and cannot find any code to help me with this. I have a UITextView that I need to resign first responder of when the user presses the 'Done' button on their keyboard. I have seen code floating around the internet like this: -(BOOL) textFieldShouldReturn:(UITextField *)textField { [textField resignFirstResponder]; return NO; } But that will not work for a UITextView . Simply put, How can I tell when the user presses the done button on