2021年1月19日星期二

I'm implementing a marquee effect but its not working on Android Studio

I'm implementing a marquee effect but its not working on Android Studio. This is the code This is the .xml file part for the textview:

<?xml version="1.0" encoding="utf-8"?>  <ScrollView 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">        <androidx.constraintlayout.widget.ConstraintLayout          android:layout_width="match_parent"          android:layout_height="match_parent">        <TextView              android:id="@+id/logos"              android:layout_width="match_parent"              android:layout_height="wrap_content"              android:layout_marginTop="36dp"              android:ellipsize="marquee"              android:fadingEdge="horizontal"              android:fontFamily="serif-monospace"              android:marqueeRepeatLimit="marquee_forever"              android:scrollHorizontally="true"              android:singleLine="true"              android:text="TRAVEL PORTAL"              android:textSize="36sp"              android:textStyle="bold"              app:layout_constraintTop_toTopOf="parent"              tools:layout_editor_absoluteX="62dp" />  

This is my main_activity code:

protected void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          setContentView(R.layout.activity_main);          TextView logos = findViewById(R.id.logos);          logos.setEllipsize(TextUtils.TruncateAt.MARQUEE);          logos.setSelected(true);  }  
https://stackoverflow.com/questions/65802100/im-implementing-a-marquee-effect-but-its-not-working-on-android-studio January 20, 2021 at 10:04AM

没有评论:

发表评论