Androidlayout heightwrap content androidtextSizedimensixteen sp

Compiled resource datatype: Resource pointer to a PaintDrawable

Resource reference name:

• XML: @[package:]drawable/some_name (where some_name is the name of a specific resource)

Syntax

<drawable name=color name>color value</drawable>

<drawable> A valid color value.

• name - The name used in referring to this drawable. Example XML Declaration

The following code declares several color drawables.

<resources>

<drawable

name=

"solid

red">#f00</drawable>

<drawable

name=

"solid

blue">#0000ff</drawable>

<drawable

name=

"solid

green">#f0f0</drawable>

</resources>

Example Code Use Example Java code

// Assign a PaintDrawable as the background to // a TextView on the current screen.

Drawable redDrawable = Resources.getDrawable(R.drawable.solid red); TextView tv = (TextView)findViewBylD(R.id.text); tv.setBackground(redDrawable);

Example XML code

<TextView android:layout width="fill parent"

android:layout height="wrap content" android:textAlign="center"

android:background="@drawable/solid red"/>

0 0

Post a comment