A?n?d?r?o?i?d? ?开?发?中?怎?么?使?用?自?定?义?字?体??

2014-05-22 00:36
1、Android系统默认支持三种字体,分别为:“sans”, “serif”, “monospace  
2、在Android中可以引入其他字体 。 
<?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" > 
    <TableRow> 
        <TextView
            Android:layout_marginRight="4px"             Android:text="sans:"             Android:textSize="20sp" >         </TextView>
        <!-- 使用默认的sans字体 --> 
        <TextView
            Android:id="@+id/sans"             Android:text="Hello,World"             Android:textSize="20sp"             Android:typeface="sans" >         </TextView>     </TableRow> 
    <TableRow>
 
        <TextView
            Android:layout_marginRight="4px"             Android:text="serif:"
            Android:textSize="20sp" >         </TextView>
        <!-- 使用默认的serifs字体 --> 
        <TextView
            Android:id="@+id/serif"             Android:text="Hello,World"             Android:textSize="20sp"             Android:typeface="serif" >         </TextView>     </TableRow> 
    <TableRow>

^