Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Case A is a reference to a style attribute. It allows you to reference a particular piece of style information without knowing its actual value. There are a lot of Android-defined attributes that are used to style the Android UI, but you can also define you own attributes.</p> <p><a href="http://developer.android.com/reference/android/R.attr.html#actionBarItemBackground" rel="nofollow"><code>actionBarItemBackground</code></a> is one such attribute. There are two ways you can use this attribute:</p> <ol> <li><p>You can reference it to make the look and feel of UI elements consistent with action bar items:</p> <pre class="lang-xml prettyprint-override"><code>&lt;com.mycompany.MyView android:id="@+id/myView" android:background="?attr/actionBarItemBackground"/&gt; </code></pre></li> <li><p>You can define a theme and set the value of this attribute to override the default L&amp;F for your app:</p> <pre class="lang-xml prettyprint-override"><code>&lt;style name="MyTheme" parent="@android:style/Theme"&gt; &lt;item name="android:actionBarItemBackground"&gt;#383c44&lt;/item&gt; &lt;/style&gt; </code></pre></li> </ol> <p>Here are some pointers to the Android documentation:</p> <p>For styles an themes see:<br> <a href="http://developer.android.com/guide/topics/ui/themes.html" rel="nofollow">http://developer.android.com/guide/topics/ui/themes.html</a>.</p> <p>For a list of all attributes see:<br> <a href="http://developer.android.com/reference/android/R.attr.html" rel="nofollow">http://developer.android.com/reference/android/R.attr.html</a></p> <p>For defining your own attributes there is no documentation. Have a look at one of the <code>attrs.xml</code> files in the SDK (e.g. under <code>platforms\android-17\data\res\values</code>) to see how style attributes are declared. You can declare attributes in the same way by putting an <code>attrs.xml</code> file in your <code>res\values</code> folder. You can then use these attributes in your own styles and themes.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload