Resource cannot be found, No identifier for missing item

后端 未结 3 1479
轮回少年
轮回少年 2020-12-19 15:20

I looked at this question however, it did not help solve my problem:

  • Resources$NotFoundException: Resource is not a Drawable

I\'m using ActionBa

3条回答
  •  独厮守ぢ
    2020-12-19 15:48

    To support lower versions, instead of removing the following three parameters,

      android:textAppearance="?android:attr/textAppearanceListItemSmall" 
      android:background="?android:attr/activatedBackgroundIndicator"
      android:minHeight="?android:attr/listPreferredItemHeightSmall"
    

    You can actually replace them with equivalent values/resources.

    The equivalent values can be obtained from https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/themes.xml

    Now,

    • a) android:textAppearance="@android:style/TextAppearance.Medium"

    • b)

      1. Download a selector from https://github.com/habzy/Test0011_DialerPad/blob/master/res/drawable/list_item_activated_background.xml

      2. In the above project browse the resources in hdpi,mdpi etc and get files named list_activated_holo.9.png

      3. Finally

      android:background="@drawable/activated_background_holo_dark"

    • c) From the equivalent values obtained , we know that listPreferredItemHeightSmall is 48dip

      android:minHeight="48dip"

提交回复
热议问题