質問

資産を適切にインスタンス化する方法は?

読み込みたいファイルがあり、エラーが発生しています。

これが私が持っているものです:

     AssetManager assetManager = new AssetManager(handle);

     Typeface tf = Typeface.CreateFromAsset(assetManager, "fonts/calibri.ttf");

     this._textView.SetTypeface(tf, 0); // i just need a regular calibri, I added a file into the fonts folder and set it to AndroidAsset.

この場合、「ハンドル」は何ですか?

ありがとうございました

役に立ちましたか?

解決

AssetManager assetManager = getResources().getAssets();

他のヒント

これがモノドロイドの場合、Javaのget*()構文は.NETプロパティに変換されているため、次のようになります。

AssetManager assetManager = Resources.Assets;
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top