gpt4 book ai didi

android - 如何在android中获得自动滚动 TextView

转载 作者:行者123 更新时间:2023-11-29 21:48:54 29 4
gpt4 key购买 nike

我在页脚中有 TextView ,我想在页脚中滚动该文本。这是我的代码 fragment ,但该文本不可滚动。任何人都可以帮助我提前致谢 我的代码

public class Footer extends RelativeLayout{
private TextView footer_TextVeiw;
ImageView logout;
public Footer(Context context, AttributeSet attrs) {
super(context, attrs);
String infService = Context.LAYOUT_INFLATER_SERVICE;
LayoutInflater li = (LayoutInflater) getContext().getSystemService(infService);
li.inflate(R.layout.footer_layout, this, true);
footer_TextVeiw= (TextView) this.findViewById(R.id.text_Footer);
footer_TextVeiw.setSelected(true); } }

我的 XML 布局

<RelativeLayout  xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Footer" >


<TextView
android:id="@+id/text_Footer"
android:layout_width="fill_parent"
android:layout_height="25dp"
android:layout_alignParentBottom="true"
android:background="#ECEFF5"
android:layout_centerHorizontal="true"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:scrollHorizontally="true"
android:ellipsize="marquee"
android:text="@string/Footer"
/>


</RelativeLayout>

最佳答案

你可以试试属性android:scrollbars="vertical"or Horizo​​ntal

关于android - 如何在android中获得自动滚动 TextView ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14976357/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com