Erlo

安卓开发笔记(二十七):实现轮播文字消息

2019-04-24 22:01:49 发布   215 浏览  
页面报错/反馈
收藏 点赞

仅仅写个xml就够了,太简单了

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@drawable/timg"
    tools:context=".MainActivity">
    <TextView
        android:layout_marginTop="200dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="想看妹子吗?身为男人不想看妹子怕是个沙雕吧,本站提供丰富的妹子资源,尽请享受"
        android:textColor="@color/colorAccent"
<#gth#         下面开始对于轮播的设置         -->
        android:singleLine="true"<#gth#是否单行显示-->
        android:ellipsize="marquee"<#gth#超出部分进行轮播显示 -->
        android:focusable="true"<#gth# 下面这两个属性和焦点有关,反正设置为true就好了-->
        android:focusableInTouchMode="true"
<#gth#     轮播设置完毕            -->
        android:padding="20dp"/>

</LinearLayout>

 

登录查看全部

参与评论

评论留言

还没有评论留言,赶紧来抢楼吧~~

手机查看

返回顶部

给这篇文章打个标签吧~

棒极了 糟糕透顶 好文章 PHP JAVA JS 小程序 Python SEO MySql 确认