1、Resources resources = mContext.getResources();Drawable drawable = resources.getDrawable(R.drawable.a);imageview.setBackground(drawable);2、Resources ...
分类:
其他好文 时间:
2015-10-16 15:12:09
阅读次数:
137
1.在程序中获取string.xml中字符串和数值 Hello World, MainActivity! TestExample01在Activity中使用:String appName=(String) this.getResources().getText(R.string.app_name);...
分类:
移动开发 时间:
2015-10-15 23:22:33
阅读次数:
234
1.在string.xml文件中: %1$d清理内存:%2$sMB]]>2. 代码中设置textView内容textView.setText(Html.fromHtml(String.format(getResources().getString(R.string.tips_all),process...
分类:
移动开发 时间:
2015-10-14 14:03:22
阅读次数:
251
Drawable drawable = mContext.getResources().getDrawable(R.drawable.duringtime);drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimu...
分类:
其他好文 时间:
2015-10-09 12:17:26
阅读次数:
105
1,drawable转bitmap// 获取待处理的图像BitmapDrawable tmpBitDra = (BitmapDrawable) getResources().getDrawable(R.drawable.ic_launcher);Bitmap tmpBit = tmpBitDra.g...
分类:
其他好文 时间:
2015-10-06 11:40:14
阅读次数:
146
转 http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2012/1201/655.html一.基本介绍数据包package:android.content.res主要类:ResourcesInputStream openRawResource...
分类:
移动开发 时间:
2015-09-24 10:41:41
阅读次数:
195
public int getStatusBarHeight() { int result = 0; int resourceId = mainActionView.getContext().getResources().getIdentifier("status_bar...
分类:
移动开发 时间:
2015-09-18 18:20:25
阅读次数:
172
可移动控件:效果图:获取屏幕的宽高:1 DisplayMetrics dm = getResources().getDisplayMetrics();2 screenWidth = dm.widthPixels;3 screenHeight = dm....
分类:
移动开发 时间:
2015-09-18 15:27:20
阅读次数:
167
Lesson3 - 设计新闻分类导航UIarrays.xml定义一个数组String[] categoryArray = getResources().getGridView category = new GridView(this);category.setNumColumns(GridView....
分类:
移动开发 时间:
2015-09-13 09:18:16
阅读次数:
310
使用 更换src图片mPauseButton.setImageResource(getResources().getIdentifier( "mediacontroller_play", "drawable", mContext.getPackageName()));
分类:
其他好文 时间:
2015-09-11 18:53:24
阅读次数:
180