<pre name="code" class="html"><TextView
android:id="@+id/mygonggao"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="5dp"
android:background="#FF5511"
android:clickable="true"
android:ellipsize="marquee"
android:focusable="true"
android:gravity="center"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="今日公告:今天晚上图书馆一楼科研报告厅举行互联网+学术报告会" >
</TextView>
<pre name="code" class="html">clickable true 可被点击
<pre name="code" class="html">focusable <span style="color: rgb(51, 51, 51); font-family: arial; font-size: 13px; line-height: 20px;">就是移动光标是这个控件是否会变成选中状态 true 会 false 不会</span>
<span style="color: rgb(51, 51, 51); font-family: arial; font-size: 13px; line-height: 20px;"><strong><span style="color: rgb(255, 0, 0); font-family: Arial; font-size: 14px; line-height: 26px;">android:ellipsize=”start”—–省略号显示在开头 "...pedia"</span><br style="color: rgb(255, 0, 0); font-family: Arial; font-size: 14px; line-height: 26px;" /><span style="color: rgb(255, 0, 0); font-family: Arial; font-size: 14px; line-height: 26px;">android:ellipsize=”end”——省略号显示在结尾 "encyc..."</span><br style="color: rgb(255, 0, 0); font-family: Arial; font-size: 14px; line-height: 26px;" /><span style="color: rgb(255, 0, 0); font-family: Arial; font-size: 14px; line-height: 26px;">android:ellipsize=”middle”—-省略号显示在中间 "en...dia"</span><br style="color: rgb(255, 0, 0); font-family: Arial; font-size: 14px; line-height: 26px;" /><span style="color: rgb(255, 0, 0); font-family: Arial; font-size: 14px; line-height: 26px;">android:ellipsize=”marquee”–以横向滚动方式显示(需获得当前焦点时)</span></strong></span>
<span style="color: rgb(51, 51, 51); font-family: arial; font-size: 13px; line-height: 20px;"></span><pre name="code" class="html"><span style="font-family: Arial; font-size: 14px; line-height: 26px;">gravity 是 控件中显示的内容 </span>
marqueeRepeatLimit 设置滚动循环的次数
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"></span><pre name="code" class="html">scrollHorizontally="true" <span style="font-family: Arial;">满了后是自动横着移动不是默认的换行</span><pre name="code" class="html">singleLine="true" 设置单行