Coder Social home page Coder Social logo

can it be done with a uitextview? about rqshinelabel HOT 3 OPEN

 avatar commented on July 17, 2024
can it be done with a uitextview?

from rqshinelabel.

Comments (3)

NBibikov avatar NBibikov commented on July 17, 2024

@johnsd have you found the answer? I also need work it with UITextView

from rqshinelabel.

zipme avatar zipme commented on July 17, 2024

It's possible since the plugin is relying on attributeText property of UILabel which UITextView also has, I am thinking of rewriting this plugin in Swift 2.0, and by taking advantage of extension/protocol we can avoid lots of code duplication.

In the meantime, you can just copy RQShineLabel.h/m and change the subclass UILabel to UITextView, (perhaps also change ShineLabel to ShineTextView 😉) Things should just work.

from rqshinelabel.

NBibikov avatar NBibikov commented on July 17, 2024

Thanks! I done it with change sublacss to UITextView and add some property for mutableAttributedString(because without it i cann't change font family, font size and alignment in my controller)

[mutableAttributedString addAttribute:NSFontAttributeName
                                value:self.typeSizeFont
                                range:NSMakeRange(0, mutableAttributedString.length)];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping;
paragraphStyle.alignment = NSTextAlignmentCenter;
[mutableAttributedString addAttribute:NSParagraphStyleAttributeName
                       value:paragraphStyle
                       range:NSMakeRange(0, mutableAttributedString.length)];

from rqshinelabel.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.