-1

I have this line in my account_particle.xml layout

            android:padding="?attrs/disc_padding"

this attrs.xml:

<resources>
  <declare-styleable name="AccountParticle">

    <attr name="text_margin_start" format="reference"/>
    <attr name="disc_padding" format="reference"/>
    <attr name="disc_imageViewSize" format="reference"/>


  </declare-styleable>
</resources>

and this styles.xml:

<style name="Theme.ap.header" parent="Theme.AppCompat">
    <item name="disc_padding">@dimen/account_menu_header_signed_in_avatar_margin_start</item>
  </style>

  <style name="Theme.ap.list_item" parent="Theme.AppCompat">
    <item name="disc_padding">@dimen/account_menu_account_list_item_avatar_margin_start</item>



      </style>

Why do i get this compilation error?

 error: Error: No resource found that matches the given name (at 'padding' with value '?attrs/disc_padding').

AccountParticle

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Elad Benda
  • 35,076
  • 87
  • 265
  • 471

1 Answers1

0

Try to replace android:padding="?attrs/disc_padding"

with android:padding="?attr/disc_padding" or android:padding="?disc_padding"

Dewey Reed
  • 4,353
  • 2
  • 27
  • 41