码上敲享录 > android开发实例 > Android跑马灯不生效

Android跑马灯不生效

上一章章节目录下一章 2018-04-05已有6465人阅读 评论(0)

Android跑马灯不生效原因在这里


解决方法:

1.android:text文字太短,设置长点即可,正确的activity_main.xml文件如下:

<TextView

       android:id="@+id/textView1"

       android:layout_width="match_parent"

       android:layout_height="wrap_content"

       android:ellipsize="marquee"

       android:focusable="true"

       android:focusableInTouchMode="true"

       android:marqueeRepeatLimit="marquee_forever"

       android:singleLine="true"

       android:text="长度长度长度长度长度长度长度长度长度长度长度长度"

       android:textAllCaps="true"

       android:textColor="#f00"

       android:textSize="22sp" />

2.后端没重写onCreate方法,无法加载activity_main.xml文件

public class MainActivity extends Activity {

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

}}

本文地址:http://www.yayihouse.com/yayishuwu/chapter/1138

向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti
1

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交