开发者

AssetManage instantiation

开发者 https://www.devze.com 2023-01-31 03:08 出处:网络
How to properly instantiate AssetManage? I have a file that I\'d like to load and I am getting an error.

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 hav开发者_Go百科e:

     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


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

AssetManager assetManager = Resources.Assets;


AssetManager assetManager = getResources().getAssets();
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号