문제

How to properly instantiate AssetManage?

I have a file that I'd like to load and I am getting an error.

Here is what I have:

     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.

What should be a "handle" in this case?

Thank you

도움이 되었습니까?

해결책

AssetManager assetManager = getResources().getAssets();

다른 팁

If this is MonoDroid, Java's get*() syntax has been turned into .NET properties, so it's:

AssetManager assetManager = Resources.Assets;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top