2011-08-01 4 views
1

漫画フォントが使用され、assetsフォルダから取得できるアプリケーションを1つ開発しています。今私はテキストを太字にしたいと思います。だから私は単純に使用します。テキストフォントスタイルが表示されない

Typeface face=Typeface.createFromAsset(this.getAssets(), "fonts/comic.TTF"); 
    la = (TextView) findViewById(R.id.la); 
    la.setText("Dog"); 

    la.setTextAppearance(getApplicationContext(),R.style.boldText); 
    la.setTypeface(face); 

string.xmlを

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <string name="hello">Hello World, timerTest!</string> 
    <string name="app_name">timerTest</string> 

    <style name="boldText"> 
     <item name="android:textStyle">bold</item> 

    </style> 
</resources> 

私は適切に取得するが、大胆なスタイルはtext

+1

私たちがカスタムフォントを使用しているときは、どんなフォントスタイルも使用できないと思います... –

答えて

1
Typeface face=Typeface.createFromAsset(this.getAssets(), "fonts/comic.TTF"); 

     la = (TextView) findViewById(R.id.la); 
     la.setText("Dog"); 
     la.setTypeface(face,Typeface.BOLD);  
に表示されませんcomic.ttfプロジェクトを実行する際に問題があります
関連する問題