无法在标签栏中动态设置图标

时间:2014-02-13 17:11:52

标签: android android-layout android-tabhost tabbar android-tabs

我试图动态设置TabBar图标,首先从服务器下载它们,然后将它们设置为:

String path = context.getFilesDir().getAbsolutePath() + "/HDPI/" +"dial.png";
File imgFile = new File(path);
Drawable icon = Drawable.createFromPath(imgFile.getAbsolutePath());
dialer.setIndicator(getString(R.string.Keypad), icon).setContent(dialerIntent);    

我这样做的输出如下:
enter image description here

我得到了正确的图像,但图像的大小却减少了 我不明白为什么会如此。如果有人能够弄清楚我犯的错误或者可以建议我采取一些新方法,我将不胜感激。

感谢。

0 个答案:

没有答案