title: Required custom attributes
body: <p>android:layout_width and android:layout_height are required attributes, i.e. if you don't specify them for a Layout, Android Studio tells me "Element x doesn't have required attribute android:layout_height."</p>
  
  <p>I'm defining some custom attributes in my own classes and I'd like to require that anyone who uses them in xml specify values just like they have to specify layout_width and layout_height.</p>
  
  <p>How do I do that? Is there something I can add in attrs.xml here:</p>
  
  <pre><code>&lt;declare-styleable name="MyStyleable"&gt;
     &lt;attr name="myAttribute" format="float"/&gt;
  &lt;/declare-styleable&gt;
  </code></pre>
  
  <p>Or maybe in style.xml here:</p>
  
  <pre><code>&lt;style name="MyStyle"&gt;
      &lt;item name="myAttribute"&gt;3&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>