ExpandableTextView正确使用-古蔺大橙子建站
RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
ExpandableTextView正确使用

下载ExpandableTextView库,新建项目关联库。使用关键点:要把ExpandableTextView放在LinearLayout布局下,否则点击展开,收起按钮,文本不能展开,收起。

公司主营业务:网站设计、成都网站建设、移动网站开发等业务。帮助企业客户真正实现互联网宣传,提高企业的竞争能力。创新互联建站是一支青春激扬、勤奋敬业、活力青春激扬、勤奋敬业、活力澎湃、和谐高效的团队。公司秉承以“开放、自由、严谨、自律”为核心的企业文化,感谢他们对我们的高要求,感谢他们从不同领域给我们带来的挑战,让我们激情的团队有机会用头脑与智慧不断的给客户带来惊喜。创新互联建站推出宁县免费做网站回馈大家。

在activity代码

ExpandableTextView expandTextView= (ExpandableTextView) findViewById(R.id.expand_text_view);

expandTextView.setText("注意:ExpandableTextView要放在线性布局里,这样文本才能上下缩放!maxCollapsedLines设置行数,如果超过按钮显示,文本收起;contentTextSize文本大小;contentTextColor文本颜色;expandDrawable展开按钮图片;expandText展开按钮文本;collapseDrawable折叠按钮图片;collapseText折叠按钮文本;DrawableAndTextGravity按钮位置 ,center,left,right可选");

xml布局:

    xmlns:app="http://schemas.android.com/apk/res-auto"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    >

   

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:orientation="vertical" >

       

            android:id="@+id/expand_text_view"

            android:layout_width="match_parent"

            android:layout_height="wrap_content"

            app:maxCollapsedLines="2" 

            app:contentTextSize="20sp"

            app:contentTextColor="#ff0000"

            app:expandText="显示"

            app:collapseText="隐藏"

            app:DrawableAndTextGravity="center">

       

   

附件:http://down.51cto.com/data/2366494

文章名称:ExpandableTextView正确使用
浏览路径:http://scgulin.cn/article/igdipj.html