Referencing enumerated style attributes from XML in Android
<p>I have an app that requires scrollbars to be enabled in one landscape orientation but not in portrait orientation.  I thought the easiest way to do this would be to make an attribute indicating whether the scrollbar is enabled or not, such as the following:</p>

<pre><code>&lt;ScrollView
        a:layout_width="fill_parent"
        a:layout_height="fill_parent"
        a:scrollbars="?my_activity_scrollbars"
        a:fadingEdge="none"
        &gt;
</code></pre>

<p>I would then define separate values of the attribute for landscape and portrait modes.  Seemed easy.  </p>

<p>So I then defined this attribute in attrs.xml:</p>

<pre><code>&lt;resources&gt;
  &lt;declare-styleable name="Theme"&gt;
    &lt;attr name="my_activity_scrollbars" format="enum" /&gt; 
  &lt;/declare-styleable&gt;
&lt;/resources&gt;
</code></pre>

<p>And added it to my app's styles.xml:</p>

<pre><code>&lt;style name="MyApp" parent="@android:style/Theme.Light"&gt;
    &lt;item name="add_credit_card_scrollbars"&gt;none&lt;/item&gt; 
&lt;/style&gt;
</code></pre>

<p>However, when I try to compile my app, I get the following error:</p>

<pre><code>styles.xml:8: error: Error: String types not allowed (at 'my_activity_scrollbars' with value 'none').
</code></pre>

<p>It seems clear that it's treating "none" as a string rather than an enumerated value.  Rather than using "none" I tried things like "?android:attr/scrollbars/none", "?android:attr/none", etc, but those didn't work.</p>

<p>How can I specify the "none" value as an enumerated value instead of a string?</p>
