Thursday, June 21, 2012
Thursday, June 14, 2012
Using color in Android, by XML
example:

/res/values/mycolor.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="red">#ff0000</color>
<color name="green">#00ff00</color>
<color name="blue">#0000ff</color>
</resources>
/res/layout/main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/background"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<!-- "white" defined in Android base set of colors -->
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="WHITE"
android:textColor="@android:color/white"
android:id="@+id/whitebutton"
/>
<!-- direct define textColor -->
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="RED"
android:textColor="#ff0000"
android:id="@+id/redbutton"
/>
<!-- "green" defined in mycolor.xml -->
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="GREEN"
android:textColor="@color/green"
android:id="@+id/greenbutton"
/>
<!-- "blue" defined in mycolor.xml -->
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="BLUE"
android:textColor="@color/blue"
android:id="@+id/bluebutton"
/>
</LinearLayout>
Thursday, May 24, 2012
Tutorial Links
http://www.androidtics.com/
https://getsatisfaction.com/luci/topics/android_development_guide
http://mobiforge.com/designing/story/understanding-user-interface-android-part-1-layouts
http://thenewboston.org/list.php?cat=6
https://getsatisfaction.com/luci/topics/android_development_guide
http://mobiforge.com/designing/story/understanding-user-interface-android-part-1-layouts
http://thenewboston.org/list.php?cat=6
Wednesday, May 23, 2012
Subscribe to:
Posts (Atom)