hymanme / expandtextview Goto Github PK
View Code? Open in Web Editor NEW一个可折叠和展开的TextView控件,很实用。
License: Apache License 2.0
一个可折叠和展开的TextView控件,很实用。
License: Apache License 2.0
推荐在mContentView.setLayoutParams(layoutParams)那段前加个判断,判断是不是需要mContentView设置位最小行数的高度,在setContent的时候加个展开图标的隐藏判断,毕竟有时候服务器返回的数据没那么多。
我这现在是这么改了下setContent:
mShowMore.setVisibility(getMaxMeasureHeight() <= getMinMeasureHeight() ? GONE : VISIBLE);
if(getMaxMeasureHeight()>=getMinMeasureHeight()){
ViewGroup.LayoutParams layoutParams = mContentView.getLayoutParams();
layoutParams.height = getMinMeasureHeight();
mContentView.setLayoutParams(layoutParams);
}
同时去掉了init中的mContentView.setLayoutParams(layoutParams);
不知道有没有更好的方法
假如最小行数6行,刚好6行,这个时候不需要图标,如何让隐藏
你这个内容可以设置3行后显示......吗?布局里面设置maxLines=“3”,ellipsize="end"不起作用啊,设置singleLine="true"只显示一行
发现可以在源码中禁用可选 mTitleView.setTextIsSelectable(false);
mContentView.setTextIsSelectable(false);
mHintView.setTextIsSelectable(false);
当设置minVisibleLines="1"的时候显示会出现问题,显示出来的内容有问题
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.