码迷,mamicode.com
首页 >  
搜索关键字:getresources    ( 268个结果
安卓突击:绘制图像
两种方法,1,canvas.drawBitmap();2,drawable.draw(canvas);Bitmap.Config.ARGB_8888:代表的是RGB每个占8个字节,透明度通道占8个字节。首先是使用InputStream is= context.getResources().openR...
分类:移动开发   时间:2015-07-13 00:38:42    阅读次数:134
Android 基础一 TextView,Style样式,Activity 传值,选择CheckBox 显示密码
1.修改TextView字体mTextView = (TextView) findViewById(R.id.textview1);mTextView.setText("I am here");Resources resources = getBaseContext().getResources()...
分类:移动开发   时间:2015-07-11 17:57:10    阅读次数:152
关于Canvas的旋转和平移
DrawablenewDrawable=getResources().getDrawable(mImageIds[newState]).mutate();DrawableoldDrawable=getResources().getDrawable(mImageIds[oldState]).mutate();Bitmapbitmap=null;bitmap=Bitmap.createBitmap(width,bitmapHeight,Bitmap.Config.ARGB_8888);Canvascanvas=n..
分类:其他好文   时间:2015-07-09 22:52:03    阅读次数:370
Button 按钮字体颜色实现
btn.setTextColor(mContext.getResources().getColor(R.color.selector_sku_btn_tv));这个是定义在String里的如果是xml里的话要XmlPullParserxrp=mContext.getResources().getXml(R.color.selector_sku_btn_tv);ColorStateListcsl;try{csl=ColorStateList.createFromXml(mConte..
分类:其他好文   时间:2015-07-08 22:53:54    阅读次数:142
使用代码为TextView设置drawableLeft
直接上代码:类似调用方法如下:1.在XML中使用Java codeandroid:drawableLeft="@drawable/icon"2.代码中动态变化Java codeDrawable drawable= getResources().getDrawable(R.drawable.drawa...
分类:其他好文   时间:2015-07-08 12:18:42    阅读次数:130
Android 用代码设置颜色
两种方法:1. tv.setTextColor(Color.parseColor("#abcdef"));2. tv.setTextColor(getResources().getColor(R.color.black));注:以下写法是错误的tv.setTextColor(R.color.black); //错误的...
分类:移动开发   时间:2015-07-06 17:45:49    阅读次数:141
获取资源文件
1.进入assets文件夹//access to the folder “assets”AssetManager am = this.getResources().getAssets(); InputStream is = am.open("plist/Exposant.plist");//read...
分类:其他好文   时间:2015-07-04 11:02:35    阅读次数:114
Android 获取dimen值
int dip = (int) TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP, 70, getResources().getDisplayMetrics());...
分类:移动开发   时间:2015-07-02 12:28:51    阅读次数:1215
android TypedValue.applyDimension()的探究
这个方法是转变为标准尺寸的一个函数,例如int size = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 20, context.getResources().getDisplayMetrics());这里COMPLEX_U...
分类:移动开发   时间:2015-06-28 01:13:48    阅读次数:247
getResources()方法
今天做一个Android文件管理器。它使用了很多当地的用途getResources。Drawable currentIcon = null; ……………… currentIcon = getResources().getDrawable(R.drawable.folder); ……………… ...
分类:其他好文   时间:2015-06-21 10:35:02    阅读次数:155
268条   上一页 1 ... 9 10 11 12 13 ... 27 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!