Swift: Dynamically Size UICollectionViewCell
It's possible that while you are setting the width to 80% inside of your estimatedFrame function that you are not factoring in the padding within the UITextView and that the slight difference in available width in the textview vs the 80% calculation is resulting in a different height being calculated.
How to set UITextView's height dynamically in UITableViewCell based on string size?
When using Auto-Layout for dynamically sizing cells, you don't really need to implement sizeThatFits(...)
. If the constraints are setup correctly, then you only need to disable the scrolling of the UITextView
.
From code:
yourTextView.scrollEnabled = false
From IB:
Select your Text View and open Attributes inspector, then
Related Topics
Root Class of All Classes in Swift
Compiler Segmentation Fault While Using Set in Swift
User Specific Avatar in Jsqmessagesviewcontroller with Sdwebimage
Capturing Still Image with Avfoundation
Swiftui: Make Remaining Area of List Item Detect Clicks
How to Change an Associated Value Within an Enum
Swiftsupport Folder Not Included in The IPA When Generating Build from Script
Swiftui Wrapping Hstack with Images
Calling Consecutive Animations in Swift with Completion Handler
Is There a Difference Between Global Initialization Vs Viewdidload Initialization in Swift
How to Implement Applescript Support in a Swift Macos App
Extension for Array Where Element Is Optional
How to Change an Inout Parameter from Within a Escaping Closure
How to Get The Nearest Int Floored from a Sqrt of an Int
Avspeechsynthesizer Isspeaking Not Working in Swift
Swift String Indexing Combines "\R\N" as One Char Instead of Two