Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/181.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/rest/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android &引用;“未知可提取资源”;错误_Android - Fatal编程技术网

Android &引用;“未知可提取资源”;错误

Android &引用;“未知可提取资源”;错误,android,Android,1) 当我使用android:src=“@drawble/party” 完整的代码如下所示。我的“party.jpg”文件在res/drable文件夹下,有什么问题 2) 我还看到android:layout\u alignRight=“8dp”“这里有什么问题 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/andr

1) 当我使用android:src=“@drawble/party” 完整的代码如下所示。我的“party.jpg”文件在res/drable文件夹下,有什么问题

2) 我还看到android:layout\u alignRight=“8dp”“这里有什么问题

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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="park.hannah.myapplication.MainActivity">

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawble/party" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="From. Hyunji"
        android:padding="8dp"/>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Happy Tuesday!!"
        android:layout_alignRight="8dp"

        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />


</RelativeLayout>

您有语法错误

@可提取/参与方,而不是@drable/参与方

用这个

 <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/party" />

我还看到“android:layout\u alignRight=“8dp”有一个错误,错误是什么 这里有问题吗

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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="park.hannah.myapplication.MainActivity">

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawble/party" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="From. Hyunji"
        android:padding="8dp"/>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Happy Tuesday!!"
        android:layout_alignRight="8dp"

        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />


</RelativeLayout>
必须根据ID将视图与另一个视图对齐

建议 对于非复杂视图布局,您也可以使用重力右视图而不是android:layout\u alignRight


尝试使用LinearLayout轻松舒适地进行不复杂的视图布局

将绘图从*.jpg重命名为*.png

它仍然会给我带来“未知资源绘图”错误。我是否需要在开始时精确定位或调用“drawble”文件夹?错误:错误:“@drawble/party”与属性android:background(attr)reference | color不兼容。错误:错误:“8dp”与属性android:layout\u alignRight(attr)引用不兼容。错误:“@drawble/party”与属性android:background(attr)reference | color不兼容。错误:“8dp”与属性android:layout\u alignRight(attr)引用不兼容。Omg I是盲的。非常感谢你!显示根文件的屏幕截图以及drawable文件夹。我没有为此代码创建根文件。我应该有一个或是自动创建的,我可以简单地从一个文件夹中拔出吗?在android studio中拍摄屏幕左侧的屏幕截图,其中显示了您的所有文件夹,如清单、包名等。