ios - Resize text view and table view cell dynamically in static table view -


I have a static table view that I am using as a script for data entry for my app. One of those cells has a UITXTView, which dynamically increases and contracts as a user type, as well as the cell is growing / shrinking with it logically. I've read many posts on this, but I think I'm throwing because I'm using a static table view.

Here's my resizing attempt (much more unsuccessful):

  - (zero) text view view: (UITextView *) textView {self.numberOfLines = (textView.contentSize .height / textView.font.lineHeight) - 1; Float height = 44.0; Height = = (textView.font.lineHeight * (self.numberOfLines - 1)); Cgrtt text viewfreight = [text view frame]; TextViewFrame.size.height = Height - 10.0; // 10 values ​​that I want to retrieve the height padding at the same time when I started the UITextView [textView setFrame: textViewFrame]; [Self.tableView startupdates]; [Self.tableView and Updates]; [Self. Set the message text under the resource: UIEdgeInsetsZero]; } - (CGFloat) Table view: (UITableView *) Table view height forRowAtIndexPath: (NSIndexPath *) indexPath {float height = 44.0; If (self.messagetextview) {height = = (auto-message sent.font.linehite * (auto-numberoffline-1)); } Return height; }   

I'll take any suggestions! Thank you.

You do not need to do anything through this code: - To change a new shape The function for which the bounding date is valid.

Add the following functions to my function, which uses the new function on iOS7 and is less than IOS on 7 older. This is basically (syntax) text: (NSString *) Text size fonts: Font size: (UIFont *) Font restricted: Tax size: (CGSize) size {if (IOS_NEWER_OR_EQUAL_TO_7) {same syntax as NSDictionary: * AttributesDictionary = [Object Endcapes with NSDictionary dictionary: font, NSFontAttributeName, zero]; CGTTF frame = [text boundingcent: with size: size option: (NSSTINGDRAWINGWEENLINEFragmentAgreen | NSSSRacingDrawingOfFont Leading) Attributes: Attribute DONITY Project: Nyl]; Return frame size; } Else {#pragma clang diagnostic push #pragma clang diagnostic ignored "-wepeprecated-declarations" return [text sizeWithFont: font constrainedSoSize: size]; #pragma clang diagnostic pop}}

You can add IOS_NEWER_OR_EQUAL_TO_7 to your prefix .pch file in your project:

  I have told from this link: -    P>   

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -