小编use*_*344的帖子

找不到包'learnapp.android.example.com.learnapp'中属性'srcCompat'的资源标识符

Error:(26) No resource identifier found for attribute 'srcCompat' in package 'learnapp.android.example.com.learnapp' 当我尝试运行我的应用程序时,我得到了.我刚刚开始学习安卓.我添加了一个新活动,并在任何xml文件中更改任何内容.

这是确切的错误:

Documents/MyProjects/LearnApp/app/src/main/res/layout/activity_display_message.xml
Error:(26) No resource identifier found for attribute 'srcCompat' in package 'learnapp.android.example.com.learnapp'
Run Code Online (Sandbox Code Playgroud)

这是我的activity_display_message.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
    android:fitsSystemWindows="true"
    tools:context="learnapp.android.example.com.learnapp.DisplayMessageActivity">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay" />

    </android.support.design.widget.AppBarLayout>

    <include layout="@layout/content_display_message" />

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_margin="@dimen/fab_margin"
        app:srcCompat="@android:drawable/ic_dialog_email" />

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

我已经阅读过类似的问题,看到了这一行

xmlns:app="http://schemas.android.com/apk/res-auto"
Run Code Online (Sandbox Code Playgroud)

要么

app:srcCompat="@android:drawable/ic_dialog_email" />
Run Code Online (Sandbox Code Playgroud)

在他们的情况下是错误的,这不是我的情况.

重要的是,此活动的父活动是MainActivity.java

android android-activity

27
推荐指数
5
解决办法
5万
查看次数

在Mac OS X上启动服务器

我正在弄清楚如何使用PHP OpenId

我已将repo克隆到~/www目录中.php-open-id/examples目录中有一些我想运行的例子.

具体来说,我想渲染页面php-open-id/examples/consumer/index.php以便更好地理解API.我在php-open-id/examples目录中启动了一个服务器

python -m SimpleHTTPServer 8000
Run Code Online (Sandbox Code Playgroud)

我导航到了 localhost://consumer/index.php

但它没有用.它显示一个用于保存文件的对话框.呈现此PHP文件的正确方法是什么?

php macos server

23
推荐指数
2
解决办法
2万
查看次数

如何使用Python从ObjectID获取id?

我试图使用PyMongo从我在MongoDB中的文档中获取id.

这是我的代码:

docQuery = db.doctors.find({"email":doc_mail})
doc_id = docQuery[0]["_id"]["$oid"]
Run Code Online (Sandbox Code Playgroud)

我也试过这个:

 doc_id = docQuery[0]["_id"]
Run Code Online (Sandbox Code Playgroud)

它们都不起作用!

python mongodb pymongo

10
推荐指数
1
解决办法
1万
查看次数

标签 统计

android ×1

android-activity ×1

macos ×1

mongodb ×1

php ×1

pymongo ×1

python ×1

server ×1