zoukankan      html  css  js  c++  java
  • Android Studio [跑马灯]

    MainActivity

    package com.xdw.secondapp;
    
    import android.graphics.Paint;
    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;
    import android.widget.TextView;
    
    public class TextViewActivity extends AppCompatActivity {
        private TextView mtv5;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_text_view);
            mtv5=findViewById(R.id.tv_5);
            mtv5.setSelected(true);
        }
    }

    activity_text_view.xm

    <?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"
        tools:context=".MainActivity"
        android:orientation="vertical">
    
      
        <TextView
            android:id="@+id/tv_5"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="瑞哥在奔跑瑞哥在奔跑瑞哥在奔跑瑞哥在奔跑"
            android:ellipsize="marquee"
            android:marqueeRepeatLimit="marquee_forever"
            android:singleLine="true"
            android:focusable="true"
            android:scrollHorizontally="true"
            android:focusableInTouchMode="true"
            android:textColor="#000000"
            android:textSize="24sp" />
    
    </LinearLayout>

       //设置为跑马灯显示

               android:ellipsize="marquee"

               //获取焦点
              android:focusable="true"

              //可以通过toucth来获得focus
              android:focusableInTouchMode="true"

              //设置重复的次数
              android:marqueeRepeatLimit="marquee_forever"

              //单行显示文字
            android:singleLine="true"

  • 相关阅读:
    theano 深度学习大全
    theano 深度学习大全
    hann function
    hann function
    matlab 各种文件的读取(及读写问题的解决)
    matlab 各种文件的读取(及读写问题的解决)
    极简代码(八)—— binary activation function
    极简代码(八)—— binary activation function
    微积分基本概念相关证明
    微积分基本概念相关证明
  • 原文地址:https://www.cnblogs.com/zlc364624/p/10701644.html
Copyright © 2011-2022 走看看