java – 使用Appcompat v7的导航抽屉 – 问题?android:attr标签

我在我的项目中使用了操作栏和导航抽屉.使用appcompat v7和v4.

我添加了appcompat v7 WITH资源.

以下是直接从Creating a Navigation Drawer发现的android示例应用程序中获取的导航抽屉列表的textview

底部的三行都导致我的应用程序失败,它构建正常,但我得到一个力量关闭,我不知道如何解决问题.我不明白为什么没有找到属性,考虑到我添加了appcompat及其资源.或者他们无法使用appcompat或其他东西?

MinSDK版本为10,代码失败.在API 10之上,代码工作正常.

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"        
    android:gravity="center_vertical"
    android:paddingLeft="16dp"
    android:paddingRight="16dp"
    android:textColor="#fff"
    android:textAppearance="?android:attr/textAppearanceListItemSmall"
    android:background="?android:attr/activatedBackgroundIndicator"
    android:minHeight="?android:attr/listPreferredItemHeightSmall"/>

解决方法

我有同样的问题.据我所知,旧的apis还没有预定义textAppearanceListItemSmall,activatedBackgroundIndicator和listPreferredItemHeightSmall.因此,如果您需要,您可以指定自己的值或删除此行并依靠您的运气.

以上是来客网为你收集整理的java – 使用Appcompat v7的导航抽屉 – 问题?android:attr标签全部内容,希望文章能够帮你解决java – 使用Appcompat v7的导航抽屉 – 问题?android:attr标签所遇到的程序开发问题。

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