码迷,mamicode.com
首页 >  
搜索关键字:getresources    ( 268个结果
Android常用代码
1、图片旋转Bitmap bitmapOrg = BitmapFactory.decodeResource(this.getContext().getResources(), R.drawable.moon);Matrix matrix = new Matrix();matrix.postRotat...
分类:移动开发   时间:2014-12-10 12:14:14    阅读次数:207
Android零碎知识(一)
public abstract Resources getResources () Return a Resources instance for your application's package.BitmapFactoryextends Objectjava.lang.Object ? ...
分类:移动开发   时间:2014-12-10 10:40:13    阅读次数:195
Android bitmap和canvas小记(转)
1.从资源中获取位图(Bitmap) 可以使用BitmapDrawable或者BitmapFactory来获取资源中的位图。 当然,首先需要获取资源:Resources res=getResources(); 使用BitmapDrawable获取位图 (1)使用BitmapDrawable ...
分类:移动开发   时间:2014-12-09 17:20:20    阅读次数:238
自定义对话框
LinearLayout sc = new LinearLayout(this); // sc.setBackgroundColor(R.color.white); sc.setBackgroundResource(R.color.black); sc.setOrientation(LinearLayout.VERTICAL); // TextView txbg = new TextView(this); // txbg.setBackgroundDrawable(getResources().getDra...
分类:其他好文   时间:2014-12-05 14:20:52    阅读次数:145
SearchView 分解设置属性
int searchPlateId = getActivity().getResources().getIdentifier("android:id/search_plate", null, null); View searchPlate = v.findViewById(searc...
分类:其他好文   时间:2014-12-03 07:02:20    阅读次数:411
获取res下面图片路劲
public void show(View v){     Resources  r = getResources();          Uri uri =  Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://"             + r.getResourcePackageName(R.drawable.ic_launc...
分类:其他好文   时间:2014-12-02 13:32:56    阅读次数:141
Android 中dp和px
dp是虚拟像素,在不同的像素密度的设备上会自动适配,比如:在320x480分辨率,像素密度为160,1dp=1px在480x800分辨率,像素密度为240,1dp=1.5px计算公式:1dp*像素密度/160 = 实际像素数float density = context.getResources()...
分类:移动开发   时间:2014-11-28 18:00:50    阅读次数:170
使用getIdentifier()获取资源Id
原文地址:使用getIdentifier()获取资源Id作者:雨点点 使用getIdentifier()方法可以方便的获各应用包下的指定资源ID。 主要有两种方法: (1)方式一 Resources resources = context.getResources(); int indent...
分类:其他好文   时间:2014-11-25 12:58:35    阅读次数:167
在初始化的过程中将一些数据文件加载到系统目录中
在android系统下使用外部资源的几种方式:   1. res - raw 目录下 InputStream is = getResources().openRawResource(R.raw.address);     2. assets 资产目录. InputStream is = getAssets().open("address.db"); 在2.3 以后才完全支持. 模...
分类:其他好文   时间:2014-11-23 13:10:09    阅读次数:192
TextView——setCompoundDrawables用法
Drawable drawable = mContext.getResources().getDrawable(R.drawable.duringtime);  drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());//必须设置图片大小,否则不显示  holder.time.s...
分类:其他好文   时间:2014-11-19 15:57:14    阅读次数:196
268条   上一页 1 ... 17 18 19 20 21 ... 27 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!