TextureGroup / Texture

Smooth asynchronous user interfaces for iOS apps.
https://texturegroup.org/
Other
8.02k stars 1.29k forks source link

AXTextNode2 when clicked on seeMore sometimes working smooth but sometime flickering #2091

Open abbasnaqvi200 opened 1 year ago

abbasnaqvi200 commented 1 year ago
if isSeeMore {
        self.sayText.truncationAttributedText = NSAttributedString(string: "...", attributes: SFAttribute.get(Attribute.themeColor, 
        .semiBold, fontSize))
        self.sayText.additionalTruncationMessage = NSAttributedString(string: "See more", attributes: 
        SFAttribute.get(Attribute.themeColor, .semiBold, fontSize))
        self.sayText.maximumNumberOfLines = 2

} else {
        self.sayText.maximumNumberOfLines = self.sayText.lineCount
        self.sayText.truncationAttributedText = NSAttributedString(string: " ", attributes: SFAttribute.get(Attribute.themeColor, 
        .semiBold, fontSize))
        self.sayText.additionalTruncationMessage = NSAttributedString(string: "See less", attributes: 
       SFAttribute.get(Attribute.themeColor, .semiBold, fontSize))
    }

self.sayText.attributedText = sayTextAttributedString

//When Clicked on SeemoreButton

func seeMoreClicked(type: String, node: HeaderNode) { debugPrint("seeMoreClicked") node.sayText.maximumNumberOfLines = node.sayText.lineCount node.setNeedsLayout() }

https://github.com/TextureGroup/Texture/assets/33291444/db29474b-438d-4c3b-b6ee-99ec7dc710bf