Super Copying blog informasi tentang teknologi, game, android, kesehatan, komputer dan adsense. Powered by Blogger.

Membuat Aplikasi Android Mengganti Jenis Huruf / Font

Jenis huruf atau Type face yang di dalam android di tulis untuk mendefinisikan jenis huruf yang anda mau tampilkan, tentunya jenis huruf di android tidak sebanyak jenis huruf seperti di operating syste seperti windows. Berikut typeface yang tersedia di android.

1. typeFace="sans"
2. typeFace="serif"
3. typeFace="monospace"
4. typeFace costum (untuk font yang kita include source file tff-nya)


Buatlah Sebuah Project Android Baru

Sebelum anda memulai membuat project, apa bila anda baru memulai membuat aplikasi android dan belum menginstal software yang diperlukan harap di instal terlebih dahulu.

Sebagai contoh buatlah progam dengan property seperti ini :
Project name           : typeFace
Built Target              : Android 2.3
Application name     : typeface
Package name         : com.wilis.typeface
Activity                    : typeface
Min SDK                : 9

1. main.xml

Ubah file main.xml menjadi seperti ini :

<?xml version="1.0" encoding="utf-8"?>
<tablelayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="1"
>
<tablerow>
<TextView
android:text="Sans : "
android:layout_marginRight="4px"
android:textSize="20sp"
/>
<TextView
android:id="@+id/sans"
android:text="http://jintoples.blogspot.com"
android:typeface="sans"
android:textSize="20sp"
/>
</TableRow>
<tablerow>
<TextView
android:text="Serif : "
android:layout_marginRight="4px"
android:textSize="20sp"
/>
<TextView
android:id="@+id/serif"
android:text="http://jintoples.blogspot.com"
android:typeface="serif"
android:textSize="20sp"
/>
</TableRow>
<tablerow>
<TextView
android:text="monospace : "
android:layout_marginRight="4px"
android:textSize="20sp"
/>
<TextView
android:id="@+id/sans"
android:text="http://jintoples.blogspot.com"
android:typeface="monospace"
android:textSize="20sp"
/>
</TableRow>
</TableLayout>
Sekarang anda jalankan program anda dengan tekan Ctrl + F11

Sumber :  Pemograman Aplikasi Mobile Smartphone dan tablet PC Berbasic Android Penerbit Informatika, Bandung, 2012 By : Nazruddin Safaat

Download Setup File from Downloader (100% Working Link)
Bagikan :
+
Previous
Next Post »

Artikel Terkait:

0 Komentar untuk "Membuat Aplikasi Android Mengganti Jenis Huruf / Font "

Silahkan berkomentar dengan bijak dan positif. Komentar anda menunjukkan sikap anda. Terima kasih :-)

 
Template By Kunci Dunia
Back To Top