【问题标题】:Error:No resource identifier found for attribute 'lable' in package 'android'错误:在包“android”中找不到属性“lable”的资源标识符
【发布时间】:2018-01-13 15:47:00
【问题描述】:

当我尝试在我的应用程序中添加启动画面时,我发现了这个错误消息。我在 Splashscreen.java 中发现了这个错误,我尝试在很多地方搜索但找不到答案,这是我的代码,请帮助我。 提前致谢。 这是错误结果图片https://gyazo.com/3ac877d4dc8cccee1607411c00d81ccc

package club.moviestreet.www.moviestreet;

import android.os.Bundle;
        import android.app.Activity;
        import android.content.Intent;
        import android.widget.ImageView;

        import club.moviestreet.www.moviestreet.MainActivity;

        import java.util.Random;


public class Splashscreen extends Activity {

    Thread splashTread;
    ImageView imageView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splashscreen);
        imageView = (ImageView)findViewById(R.id.imageView2);
        imageView.setScaleType(ImageView.ScaleType.FIT_XY);
        int[] ids = new int[]{R.drawable.s_img,R.drawable.s_image_black, R.drawable.s_image_black2};
        Random randomGenerator = new Random();
        int r= randomGenerator.nextInt(ids.length);
        this.imageView.setImageDrawable(getResources().getDrawable(ids[r]));

        splashTread = new Thread() {
            @Override
            public void run() {
                try {
                    int waited = 0;
                    // Splash screen pause time
                    while (waited < 3500) {
                        sleep(100);
                        waited += 100;
                    }
                    Intent intent = new Intent(Splashscreen.this,
                            MainActivity.class);
                    intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
                    startActivity(intent);
                    Splashscreen.this.finish();
                } catch (InterruptedException e) {
                    // do nothing
                } finally {
                    Splashscreen.this.finish();
                }

            }
        };
        splashTread.start();
    }

}

【问题讨论】:

  • 添加 Splashscreen 的 manifest 条目。
  • 怎么做,先生?因为我不知道它
  • 我在下面添加了一个答案,看看它是否适合你。

标签: android android-studio


【解决方案1】:

我知道你在清单中使用了android:lable

没有android:lable,属性为android:label

只需将 android:lable 替换为 `android:label

【讨论】:

    猜你喜欢
    • 2013-12-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多