【问题标题】:Expanded notification layout attributes can not be found 'No resource identifier found for attribute'找不到展开的通知布局属性“找不到属性的资源标识符”
【发布时间】:2016-05-25 07:11:38
【问题描述】:

我正在使用 SDK 中提供的大图像通知模板(下面的 xml)。但添加此布局后,我无法编译我的项目。

即使我使用的是架构:http://schemas.android.com/apk/prv/res/android,它应该提供 layout_minHeight 和 layout_maxHeight。

为什么我会遇到这个问题,如何解决?

错误:(5) 未找到属性的资源标识符 'android'包中的'layout_minHeight'

错误:(5) 未找到属性的资源标识符 'android'包中的'layout_maxHeight'

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:internal="http://schemas.android.com/apk/prv/res/android"
    android:id="@+id/status_bar_latest_event_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    internal:layout_minHeight="65dp"
    internal:layout_maxHeight="unbounded"
    >
    <ImageView
        android:id="@+id/big_picture"
        android:layout_width="match_parent"
        android:layout_height="192dp"
        android:layout_marginTop="64dp"
        android:layout_gravity="bottom"
        android:scaleType="centerCrop"
        />
    <ImageView
        android:layout_width="match_parent"
        android:layout_height="6dp"
        android:layout_marginTop="64dp"
        android:scaleType="fitXY"
        android:src="@drawable/title_bar_shadow"
        />
    <include layout="@layout/notification_template_material_base"
        android:layout_width="match_parent"
        android:layout_height="64dp"
        />
  <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="208dp"
        android:paddingStart="@dimen/notification_large_icon_width"
        android:layout_gravity="bottom"
        android:background="#CCEEEEEE"
        >
        <include
            layout="@layout/notification_material_action_list"
            android:id="@+id/actions"
            android:layout_gravity="bottom"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            />
    </FrameLayout>
</FrameLayout>

来源:http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.0.1_r1/frameworks/base/core/res/res/layout/notification_template_material_big_picture.xml

【问题讨论】:

    标签: java android xml layout schema


    【解决方案1】:

    将xmlns:internal="http://schemas.android.com/apk/prv/res/android" 更改为xmlns:internal="http://schemas.android.com/apk/res-auto"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-22
      • 1970-01-01
      • 2015-05-03
      • 2015-12-26
      • 2017-12-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多