フォントファイル love.ttf (5mb) があります。私はそれを資産フォルダに入れていた。これは私のコードです
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv=(TextView)findViewById(R.id.textView1);
Typeface tf=Typeface.createFromAsset(getAssets(),"love.ttf");;
tv.setTypeface(tf,Typeface.NORMAL);
tv.setTextSize(20);
}
main.xml ファイル
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#4B67A1"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="おはようございます。" />
</LinearLayout>
実行すると、テキストが表示されません!!! 大きなフォントを読み込むには?私を助けてください!ありがとう