为什么我得到一个错误:在R类中找不到符号变量

为什么我得到一个错误:在R类中找不到符号变量,第1张

概述以下源代码应制作图片并将其显示在屏幕上.但是我遇到了一些错误.无法解析符号’activity_fullscreen’,与imageView1,dummy_button,fullscreen_content和fullscreen_content_controls相同.protectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedIn

以下源代码应制作图片并将其显示在屏幕上.但是我遇到了一些错误.无法解析符号’activity_fullscreen’,与imageVIEw1,dummy_button,fullscreen_content和fullscreen_content_controls相同.

 protected voID onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentVIEw(R.layout.activity_fullscreen);        mVisible = true;        mControlsVIEw = findVIEwByID(R.ID.fullscreen_content_controls);        mContentVIEw = findVIEwByID(R.ID.fullscreen_content);        // Set up the user interaction to manually show or hIDe the system UI.        mContentVIEw.setonClickListener(new VIEw.OnClickListener() {            @OverrIDe            public voID onClick(VIEw vIEw) {                toggle();            }        });        // Upon interacting with UI controls, delay any scheduled hIDe()        // operations to prevent the jarring behavior of controls going away        // while interacting with the UI.        findVIEwByID(R.ID.dummy_button).setontouchListener(mDelayHIDetouchListener);//dummy abaendern        //super.onCreate(savedInstanceState);        //setContentVIEw(R.layout.activity_fullscreen);        this.imageVIEw = (ImageVIEw)this.findVIEwByID(R.ID.imageVIEw1);        button photobutton = (button) this.findVIEwByID(R.ID.dummy_button);        photobutton.setonClickListener(new VIEw.OnClickListener() {            @OverrIDe            public voID onClick(VIEw v) {                Intent cameraIntent = new Intent(androID.provIDer.MediaStore.ACTION_IMAGE_CAPTURE);                startActivityForResult(cameraIntent, CAMERA_REQUEST);            }        });    }

这些是我的进口:

import androID.annotation.Suppresslint;import androID.app.Activity;import androID.graphics.Bitmap;import androID.support.v7.app.Actionbar;import androID.support.v7.app.AppCompatActivity;import androID.os.Bundle;import androID.os.Handler;import androID.vIEw.MotionEvent;import androID.vIEw.VIEw;import androID.content.Intent;import androID.Widget.button;import androID.Widget.ImageVIEw;import androID.R;

现在让我们看一看activity_fullscreen.xml缺少的部分肯定在那里.

<?xml version="1.0" enCoding="utf-8"?><FrameLayout 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"    androID:background="#0099cc"    tools:context="com.example.sasha.myapplication2.FullscreenActivity">    <!-- The primary full-screen vIEw. This can be replaced with whatever vIEw         is needed to present your content, e.g. VIDeoVIEw, SurfaceVIEw,         TextureVIEw, etc. -->    <TextVIEw        androID:ID="@+ID/fullscreen_content"        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent"        androID:gravity="center"        androID:keepScreenOn="true"        androID:text="@string/dummy_content"        androID:textcolor="#33b5e5"        androID:textSize="50sp"        androID:textStyle="bold" />    <!-- This FrameLayout insets its children based on system windows using         androID:fitsSystemwindows. -->    <FrameLayout        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent"        androID:fitsSystemwindows="true">        <linearLayout            androID:ID="@+ID/fullscreen_content_controls"                        androID:layout_wIDth="match_parent"            androID:layout_height="wrap_content"            androID:layout_gravity="bottom|center_horizontal"            androID:background="@color/black_overlay"            androID:orIEntation="horizontal"            tools:ignore="Uselessparent">            <button                androID:ID="@+ID/dummy_button"                                androID:layout_wIDth="0dp"                androID:layout_height="wrap_content"                androID:layout_weight="1"                androID:text="@string/dummy_button" />            <ImageVIEw androID:ID="@+ID/imageVIEw1" androID:layout_height="wrap_content" androID:src="@drawable/icon" androID:layout_wIDth="wrap_content"></ImageVIEw>        </linearLayout>    </FrameLayout></FrameLayout>

我已经检查了the following answer中的建议.
据我所知,这些名称不包含任何非法字符.我也已经通过file-> gt重新启动了androID studio.使缓存无效/重新启动.

但是我仍然没有找到解决问题的办法. R可以解析而R的内容怎么可能?任何想法都欢迎.谢谢

解决方法:

您输入了错误的“ R”

删除此:

import androID.R;

添加:

import com.yourCompany.yourApp.R;
总结

以上是内存溢出为你收集整理的为什么我得到一个错误:在R类中找不到符号变量全部内容,希望文章能够帮你解决为什么我得到一个错误:在R类中找不到符号变量所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1091363.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存