2 months ago (09-19)  技术 |   First to comment  2 
post score 0 times, average 0.0

Introduced

Mobile development often encounters this situation: we need to do a folding function for the text that is too long, so the react Native,rn-expandabletext is a component that solves the problem, and it is used in the same way as the native text component. But when your content exceeds the specified number of lines, it will help you to automatically fold the content.Click Expand to display all content. Project Address: Https://github.com/geekeren/RN-ExpandableText

Install

NPM Install Rn-expandable-text--save

Expandabletext Usage

Demos

"Open source" rn-expandabletext:reactnative Long text folding component

Properties

Prop Description Default
NumberOfLines The max number of lines the content is, the content exceed this value, the Expandview would show. 5
Expandview A callback function to return Expand-view, you can customize the Expand-view. When it ' s null, Expand-view'll disappear
Unexpandview A callback function to return Unexpand-view. Usage the same as Expandview
Onexpand A callback when the content expands -
Oncollapse A callback when the content collapses -

Follow Me

Follow me on Wechat

"Open source" rn-expandabletext:reactnative Long text folding component

 

This article has been in the copyright printing record, protected by copyright law, without permission shall not be reproduced!If you think this article is useful for you, you can click on the "sponsor author" below to hit the author!

Reprint Annotated Original source:Baiyuan's Blog> >https://wangbaiyuan.cn/en/open-source-rn-expandabletextreactnative-long-text-folding-component-2.html

Post comment

Style

No Comment

登录

Forget password?

您也可以使用第三方帐号快捷登录

切换登录

注册

TW