View Code? Open in Web Editor
NEW
an ExpandableTextView on Android platform which can shrink TextView height if its line count is greater than a certain number, it also can toggle state between expand and shrink
expandabletextview's Issues
这样如果对TexpandableTextView设置点击事件的时候,点击伸缩按钮也会相应click事件,能否有办法把正文和后面伸缩的view给拆分开?
如题
展开按钮没有预期显示第三行尾部,而且点击展开后文字的宽度显示过小了,收起文字也分离2行显示
private CharSequence getNewTextByConfig() 函数里
switch (mCurrState){
case STATE_SHRINK: {
mLayout = new DynamicLayout(mOrigText, mTextPaint, mLayoutWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
是不是没必要调用DynamicLayout,因为mLayout不可能为空吧
layout xml:
app:etv_InitState="shrink"
kotlin code:
itemView.eptv_content.updateForRecyclerView(data, itemView.eptv_content.measuredWidth)
在RecyclerView中划出界面是还是不能正常显示,在划出屏幕时展开和收起不能正常显示,不是每个item都是很多文字时, @Carbs0126
段落右侧出现空白,同时“展开”没有在同一行,如图所示。
ExpandableTextView字体和一般的TextView的字体设置相同的textsize, 但是ExpandableTextView显示的字体偏小。
文字内容为英文时,展开收起出现了换行,
而且每行文字的行尾离边界的距离不再正确.
设置最大行数后,在recyclerview划出界面时,不足最大行数时也会显示展开。
<cn.carbs.android.expandabletextview.library.ExpandableTextView android:id="@+id/tv_describe" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="@dimen/dp_5" android:paddingBottom="@dimen/dp_10" android:textColor="@color/txt_normal1" android:textSize="@dimen/font_size_normal" app:etv_MaxLinesOnShrink="3" app:etv_ToExpandHint="全文" app:etv_ToExpandHintColor="@color/txt_red" app:etv_ToShrinkHint="收起" app:etv_EllipsisHint="" app:etv_ToShrinkHintColor="@color/txt_red" tools:text="一是非关联交易,即母公司向非关联公司出售资产,获取现金回报,并退出相关行业领域的经营产,获取现金回报,并退出相关行业领域的经并退出相关行业领域的经营产并退并退一是非关联交易,即母公司向非关联公司出售资产,获取现金回报,并退出相关行业领域的经营产,获取现金回报,并退出相关行业领域的经并退出相关行业领域的经营产并退并退一是非关联交易,即母公司向非关联公司出售资产,获取现金回报,并退出相关行业领域的经营产,获取现金回报,并退出相关行业领域的经并退出相关行业领域的经营产并退并退一是非关联交易,即母公司向非关联公司出售资产,获取现金回报,并退出相关行业领域的经营产,获取现金回报,并退出相关行业领域的经并退出相关行业领域的经营产并退并退一是非关联交易,即母公司向非关联公司出售资产,获取现金回报,并退出相关行业领域的经营产,获取现金回报,并退出相关行业领域的经并退出相关行业领域的经营产并退并退一是非关联交易,即母公司向非关联公司出售资产,获取现金回报,并退出相关行业领域的经营产,获取现金回报,并退出相关行业领域的经并退出相关行业领域的经营产并退并退一是非关联交易,即母公司向非关联公司出售资产,获取现金回报,并退出相关行业领域的经营产,获取现金回报,并退出相关行业领域的经并退出相关行业领域的经营产并退并退一是非关联交易,即母公司向非关联公司出售资产,获取现金回报,并退出相关行业领域的经营产,获取现金回报,并退出相关行业领域的经并退出相关行业领域的经营产并退并退一是非关联交易,即母公司向非关联公司出售资产,获取现金回报,并退出相关行业领域的经营产,获取现金回报,并退出相关行业领域的经并退出相关行业领域的经营产并退并退一是非关联交易,即母公司向非关联公司出售资产,获取现金回报,并退出相关行业领域的经营产,获取现金回报,并退出相关行业领域的经并退出相关行业领域的经营产并退并退域的经营产并退并退域的经营产。" />
我需要单独设置“Read More”的字体大小和style(Bold...)?