Search Results

Search found 213 results on 9 pages for 'uitextview'.

Page 1/9 | 1 2 3 4 5 6 7 8 9  | Next Page >

  • Change UITextView text color with animation.

    - by f0rz
    Hi ! Just a simple question. Is it possible to change the text color of UITextView with a animation? [UITextView beginAnimations:nil context:NULL]; [UITextView setAnimationDuration:2.0]; textView.textColor = [UIColor grayColor]; [UITextView commitAnimations]; Cheers! - Martin

    Read the article

  • UITextView Delegate shouldChangeTextInRange (or any over) doesn't get called

    - by justas wza
    Hello, I need to track changes in my UITextView method (actianly for limiting number of lines), but none of UITextViewDelegate methods are being called when editing in UITextView begins. Not even - (void)textViewDidChange:(UITextView *)textView; I dont know what Im doing wrong I added UITextViewDelegate method to header file like that: @interface PirmasViewController : UIViewController <UITextViewDelegate, MFMa...... And I put any methods for tracking changes in my implementation file: - (void)textViewDidChange:(UITextView *)textView{NSLog(@"something changed");} - (BOOL)textView:(UITextView *)aTextView shouldChangeTextInRange:(NSRange)aRange replacementText:(NSString*)aText{ NSLog(@"something changed"); return YES; }` but no rezults.

    Read the article

  • Problem setText UITextView

    - by Mat
    Hi i have a problem. I have 2 viewcontroller, in the first there is a mapView that implements the function "calloutAccessoryControlTapped" to tap a button on an annotation on the mapView; in the second there is just a UITextView. I want to change the text of the UITextView (and show the SecondViewController) in the second controller once the button on annotation is clicked; here is my code (FirstViewController) Header @interface FirstViewController<MKMapViewDelegate>{ IBOutlet MKMapView *mapView; SecondViewController *secondV;} @end Implementation @implementation FirstViewController - (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control{ secondV = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil]; NSString *myS = @"some text here"; [secondV.myTextView setText:myS]; //Switch from this to the secondview [self presentModalViewController:secondV animated:YES]; @end (SecondViewController) Header @interface SecondViewController{ IBOutlet UITextView *myTextView; } @property(nonatomic, retain)UITextView *postitTextView; - (IBAction)backToMAp; - (void)setText:(NSString *)string; @end Implementation @implementation SecondViewController - (IBAction)backToMAp{ //Back To First View; [self dismissModalViewControllerAnimated:YES];} - (void)setText:(NSString *)string{ myTextView.text = string;} In this code when i tap on the button ([self presentModalViewController:secondV animated:YES];) on annotation the first time the second view show up but the text of UITextView don't change, when i back on the FirstView ([self dismissModalViewControllerAnimated:YES];) and then again tap the button to switch again to secondView the text of UITextView change..... Sorry for long thread and for my bad english!! Thank you stack!

    Read the article

  • Can't resignFirstResponder with UITextView

    - by Calvin L
    I have a UITextView. I implemented a navigationBar UIBarButtonItem to respond to a touch and resign the firstResponder for my UITextView. But, when the selector method is called, the keyboard doesn't get dismissed. I checked the UITextView's responder status with isFirstResponder and it returns YES. I also checked it with canResignFirstResponder and the return value is NO. I must be missing something here...why is it returning NO? I get that I can override canResignFirstResponder by subclassing UITextView, but I'd like to avoid that if possible. Here's a code snippet: - (void) commentCancelButtonTouched:(id)sender { NSLog(@"Cancel button touched"); [self.navigationBar popNavigationItemAnimated: NO]; if ([self.textInput.textView canResignFirstResponder] == NO) { NSLog(@"I don't want to resign!"); } [self.textInput.textView resignFirstResponder]; }

    Read the article

  • Iphone - UITextView Memory-leak

    - by Raphael Pinto
    I have a memory leak when i use a UITextView but I don't understand why : UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(20, 160, 280, 150)]; textView.text = @"Hello World"; textView.editable = FALSE; [self.view addSubview:textView]; [textView release]; Is someone could help me? :S

    Read the article

  • Issue with UITextView in an animation block

    - by collin
    I'm having an issue with a UITextView inside another UIView whose frame is manipulated in an animation block when the keyboard displays. During the animation block the UIView scales beautifully and as expected, but the UITextView jumps out of it's superview(the UIView being animated) at the start of the animation. By the end of the animation, the UITextView ends up in the right place... what gives? Can anybody explain why the UITextView is jumping out of it's container view at the start of the animation? Thanks in advance.

    Read the article

  • How do I send text to a UITextView?

    - by Lee
    I'm new to iphone development. I'm a VB programmer who is trying to convert a VB application to an ipad app. I need some help with sending text to a UITextView. I want to first have a UIPickerView and then once the user hits a UIButton, a UITextView appears and the text is then generated by my source code code, line by line. The code would constantly be concatenating strings to the text. It would sort of go like this-- 1) User makes selections with UIPickerView. 2) User then hits UIButton. 3) UIPickerView is replaced on the screen with a UITextView. 4) The code does stuff. 5) The code adds the 1st line of text into the UITextView. 6) The code does more stuff. 7) The code then adds the 2nd line of text into the UITextView, retaining the 1st line that was already there. Steps 6 and 7 are repeated until the code is done. Does anyone know of any examples of this that I could look at? I am mostly interested in finding something like a youtube video, a webpage that explains the code or even a good book that covers this particular topic. I am finding that the sample codes that Apple has on this site goes over my head. In fact, I could probably benefit from a good book. But, I am looking for one that I would already know covers this particular topic, since it is so essential to the app that I am trying to build.

    Read the article

  • Placeholder for UITextView

    - by Gill Bates
    Anyone ever implements something in UITextView that stopping it from receiving future inputs when the text length is smaller than certain threshold? I plan to implement a textview like we have in the mail composer interface. We have a placeholder "Subject" there, and the cursor starts after. Placeholder in UITextView Inspired from this question, I wonder if there are some methods which could be used to stop changing the text in the UITextView once the cursor is moving back to the placeholder string. Any ideas?

    Read the article

  • Autoresize UITextView and UIScrollView

    - by dennis3484
    Hello guys, I already did several searches on Stack Overflow and Google, but I couldn't find a solution to my problem. I have a Detail View for a product that includes a UIScrollView and a few subviews (UIImageView, UILabel, UITextView). You can find an example here. First I wanna autoresize the UITextView (not the text itself!) to the corresponding height. Then I wanna autoresize the entire UIScrollView so that it fits the height of my UITextView and the elements above it. I've tried the following code: myUITextView.frame = CGRectMake(2.0, 98.0, 316.0, self.view.bounds.size.height); [scrollView setContentOffset:CGPointMake(0.0, 0.0) animated:NO]; scrollView.contentSize = CGSizeMake(320.0, 98.0 + [myUITextView frame].size.height); [self.view addSubview:scrollView]; 98.0 + [myUITextView frame].size.height) because my thought was: After getting the height of myUITextView, add the height of the other subviews (98.0) to it. Unfortunately it doesn't work very well. Depending on the content of the UIScrollView, it is too short or too long. I did some logging with the result that the height of the UITextView is always the same: 2010-01-27 14:15:45.096 myApp[1362:207] [myUITextView frame].size.height: 367.000000 Thanks!

    Read the article

  • How to pass touch from a UITextView to a UITableViewCell

    - by Martin
    I have a UITextView in a custom UITableViewCell. The textview works properly (scrolls, shows text, etc.) but I need the users to be able to tap the table cell and go to another screen. Right now, if you tap the edges of the table cell (i.e. outside the UItextView) the next view is properly called. But clearly inside the uitextview the touches are being captured and not forwarded to the table cell. I found a post that talked about subclassing UITextView to forward the touches. I tried that without luck. The implementation is below. I'm wondering if maybe a) the super of my textview isn't the uitableviewcell and thus I need to pass the touch some other way or b) If the super is the uitableviewcell if I need to pass something else? Any help would be much appreciated. #import "ScrollableTextView.h" @implementation ScrollableTextView - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { if (parentScrollView) { [parentScrollView touchesBegan:touches withEvent:event]; } [super touchesBegan:touches withEvent:event]; } - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { if (parentScrollView) { [parentScrollView touchesCancelled:touches withEvent:event]; } [super touchesCancelled:touches withEvent:event]; } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { if (parentScrollView) { [parentScrollView touchesEnded:touches withEvent:event]; } [super touchesEnded:touches withEvent:event]; } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { if (parentScrollView) { [parentScrollView touchesMoved:touches withEvent:event]; } [super touchesMoved:touches withEvent:event]; } - (BOOL)canBecomeFirstResponder { return YES; } @end

    Read the article

  • Concatenating NSString inside of UITextView

    - by Jason
    I'm some trouble adding strings together for a UITextView in my app. The method I've been using is this (header) #import <UIKit/UIKit.h> @interface calculatorViewController : UIViewController { IBOutlet UITextView *output; } -(IBAction)b1; @property(nonatomic, copy) NSString *output; @end (main) #import "calculatorViewController.h" @implementation calculatorViewController -(void)b1 { [output stringByAppendingString:@"hi"]; } The problem I've been having with this method is when I use the button the app crashes. The warning it gives me is 'UITextView' may not respond to '-stringByAppendingString:' When I replace output with at string it works though and that confused me. Any suggestions? Am I doing something wrong? Thanks

    Read the article

  • UITextView insert text in the textview text

    - by John Smith
    I want to have to occasionally insert text into the UITextView text object. For example, if the user presses the "New Paragraph" button I would like to insert a double newline instead of just the standard single newline. How can I go about such? Do i have to read the string from UITextView, mutate it, and write it back? Then how would I know where the pointer was? Thanks

    Read the article

  • Get text from UITextView

    - by John
    Is it possible to get the first line of text from a UITextView. I have looked through the UITextView and NSString Class References and can't find any methods that could accomplish this.

    Read the article

  • Formatting in a UITextView

    - by richard Stephenson
    hi all , im having problems with formatting for a UITextView. my app pulls in XML, saves some of it to a string , and then displays the text in a UITextView. it understands if you put a return in there, and it starts a new line. but i want to put paragraphs in there, any idea how i can pass that information without doing multiple UITextViews Thanks :)

    Read the article

  • Using a UITextView in a UITableViewCell with a UIKeyboard

    - by Luther Baker
    I have a simple UITableView that has two cells. Cell 0:0 consists of a UITextField we'll call the title and Cell 0:1 consists of a UITextView we'll simply call a note. Cell 0:0 (the text field) is a standard size, one row cell. I'm therefore trying to fill the rest of the screen up with Cell 0:1 so I return a larger height for it. This all displays just fine and I'm using most of the iPhone real estate pretty efficiently at this point. Now, when a user wants to edit one of these cells, he need only click in the appropriate textfield or textview. If a user clicks in the textfield of Cell 0:0, all is well and the keyboard slides up from the bottom. My problem occurs when a user clicks into the the textview (Cell 0:1). No matter what I try, the UITableView wants to slide the entire table view up and that generally put the UITextView in Cell 0:1 halfway out of sight. What I want to do is two fold, I'm registered for when the keyboard will appear and in that method, I'd like to shrink the UITextView in Cell 0:1 as well as shrink the UITableViewCell itself so that the keyboard doesn't have to be smart and think it has to slide the UITableViewCell into view. Unfortunately, no matter what I try, the UITableView slides up. I just want the UITableView to stand still and I want the cell to animate up/shorter with the keyboard. It appears that, by the time the keyboard is actually animating into the screen - it is to late to adjust the cell size. The UIKit has already made up it's mind that it is going to scroll the UITableView.

    Read the article

  • pulling an UIImage from a UITextView or UILabel gives white image

    - by user293139
    Hello all, I need to grab an UIImage from a UITextView or UILabel. I've got a method that will pull an image successfully from other types of views ( [UIViewController view], MKMapView, UIButtons) but I am just getting a white rect for my UITextView. I've been banging my head against the wall for a while and suspect something really, really basic. many thanks! @interface TaskAccomplishmentViewController : UIViewController { MKMapView *mapView; UILabel *timeLeftText; UITextView *challengeText; UIButton *successButton; -(void) setChallangeImageToImageFromChallenge { // works // [currChallenge setChallengeImage:[UIImageUtils grabImageFromView:mapView]]; // [currChallenge setChallengeImage:[UIImageUtils grabImageFromView:[self view]]]; // [currChallenge setChallengeImage:[UIImageUtils grabImageFromView:successButton]]; //doesn't work // [currChallenge setChallengeImage:[UIImageUtils grabImageFromView:timeLeftText]]; [currChallenge setChallengeImage:[UIImageUtils grabImageFromView:challengeText]]; } and the grabImage from a UIView code +(UIImage *)grabImageFromView: (UIView *) viewToGrab { UIGraphicsBeginImageContext(viewToGrab.bounds.size); [[viewToGrab layer] renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return viewImage; }

    Read the article

  • UITextView autoscroll to last line

    - by MihaiD
    Hi *, When writing in a UITextView more text than can fit entirely inside it, the text will scroll up and the cursor will often place itself one or two lines above the view's bottom line. This is a bit frustrating as I want my application to make good use of the entire height of the text view. Basically what I want is to configure the UITextView to write up to it's lowest part and not use it just for scrolling. I've seen some similar questions here, here and here. However I've not seen a proper solution yet. Thanks

    Read the article

  • iphone setting UITextView delegate breaks auto completion

    - by Tristan
    Hi there! I have a UITextField that I would like to enable auto completion on by: [self.textView setAutocorrectionType:UITextAutocorrectionTypeYes]; This works normally, except when I give the UITextView a delegate. When a delegate is set, auto complete just stops working. The delegate has only the following method: - (void)textViewDidChange:(UITextView *)textView { self.textView.text = [self.textView.text stringByReplacingOccurrencesOfString:@"\n" withString:@""]; int left = LENGTH_MAX -[self.textView.text length]; self.characterCountLabel.text = [NSString stringWithFormat:@"%i",abs(left)]; } Does anyone know how to have both auto complete enabled and a delegate set? Thanks!Tristan

    Read the article

  • Growing UITextView and UITableViewCell

    - by Arie Pieter
    I'd like to emulate the compose mail screen of Apples iPhone app. At this moment I have a UITableView with some cells. The last cell contains a UITextView. I managed to get the scrolling the way I like, but one problem remains: how to let the UITextView and the UITableViewCell automatically grow in height when the user enters a new line of text? There has been written a lot about this, I know. But I couldn't find any solution. Can anybody help me or just give a hint? Thanks APC

    Read the article

  • How to apply text shadow to UITextView?

    - by mystify
    Actually I love UILabel. They're sweet. Now I had to go to UITextView because UILabel is not aligning text vertically to the top. Damn. One thing I really need is a text shadow. UILabel has it. UITextView seems to not have it. But I guess that guy just uses the same underlying UIKit NSString additions?? Maybe someone already has a solution for that problem? What would I overwrite?

    Read the article

  • Save UITextView content in NSString.

    - by camilo
    Hi, I'm trying to save the contents of an UITextView into a NSString which I will somehow persist later. The problem is that the UITextView "text" property doesn't save all the rows in the textView (after touching "return"). I tried print the TextView object and the textView.text, and they're different. Does anybody know how (after editing the textView) I can save its content into a String (or something else that I can later access and share through different views and persist in the database)? Thanks a lot. Pretty sure it is simple, but I'm honestly not finding the solution.

    Read the article

  • predict location of single-line text from a UITextView

    - by William Jockusch
    Is this possible? Specifically, I have a UITextView, and the text is short enough that it will fit on a single line. I want to predict where it will appear, so that (for example) if I wanted to, I could set up a UILabel that rendered the text in exactly the same location. Once I get that figured out, what I really want to do is pick contentInset and/or contentOffset so that the text of the UITextView and the left-justified UILabel will render in the same location. But I figure the above will let me do that. EDIT: In response to a comment, the fundamental problem I am trying to get around is that UITextField does not let you set the location of the cursor. It appears a lot of people have tried to get around this without success. I need to be able to move the cursor -- inserting/deleting text there is not enough. Control cursor position in UITextField Insert string at cursor position of UITextField Moving the cursor to the beginning of UITextField iOS -- dealing with the inability to set the cursor position in a UITextField

    Read the article

  • UITextView doesn't not resize when keyboard appear if loaded from a tab bar cotroller

    - by elio.d
    I have a simple view controller (SecondViewController) used to manage a UITextview (I'm building a simple editor) this is the code of the SecondViewController.h @interface SecondViewController : UIViewController { IBOutlet UITextView *textView; } @property (nonatomic,retain) IBOutlet UITextView *textView; @end and this is the SecondViewController.m // // EditorViewController.m // Editor // // Created by elio d'antoni on 13/01/11. // Copyright 2011 none. All rights reserved. // @implementation SecondViewController @synthesize textView; /* // Implement loadView to create a view hierarchy programmatically, without using a nib. - (void)loadView { } */ // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"uiViewBg.png"]]; textView.layer.borderWidth=1; textView.layer.cornerRadius=5; textView.layer.borderColor=[[UIColor darkGrayColor] CGColor]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillAppear:) name:UIKeyboardWillShowNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillDisappear:) name:UIKeyboardWillHideNotification object:nil]; } -(void) matchAnimationTo:(NSDictionary *) userInfo { NSLog(@"match animation method"); [UIView setAnimationDuration:[[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]]; [UIView setAnimationCurve:[[userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]]; } -(CGFloat) keyboardEndingFrameHeight:(NSDictionary *) userInfo { NSLog(@"keyboardEndingFrameHeight method"); CGRect keyboardEndingUncorrectedFrame = [[ userInfo objectForKey:UIKeyboardFrameEndUserInfoKey ] CGRectValue]; CGRect keyboardEndingFrame = [self.view convertRect:keyboardEndingUncorrectedFrame fromView:nil]; return keyboardEndingFrame.size.height; } -(CGRect) adjustFrameHeightBy:(CGFloat) change multipliedBy:(NSInteger) direction { NSLog(@"adjust method"); return CGRectMake(20, 57, self.textView.frame.size.width, self.textView.frame.size.height + change * direction); } -(void)keyboardWillAppear:(NSNotification *)notification { NSLog(@"keyboard appear"); [UIView beginAnimations:nil context:NULL]; [self matchAnimationTo:[notification userInfo]]; self.textView.frame = [self adjustFrameHeightBy:[self keyboardEndingFrameHeight: [notification userInfo]] multipliedBy:-1]; [UIView commitAnimations]; } -(void)keyboardWillDisappear:(NSNotification *) notification { NSLog(@"keyboard disappear"); [UIView beginAnimations:nil context:NULL]; [self matchAnimationTo:[notification userInfo]]; self.textView.frame = [self adjustFrameHeightBy:[self keyboardEndingFrameHeight: [notification userInfo]] multipliedBy:1]; [UIView commitAnimations]; } // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } (void)dealloc { [super dealloc]; } @end the problem is that if load the view controller from a tab bar controller the textView doesn't resize when the keyboard appear, but the SAME code works if loaded as a single view based app. I hope I was clear enough. I used the tabBar template provided by xcode no modifications.

    Read the article

1 2 3 4 5 6 7 8 9  | Next Page >