1、图片旋转Bitmap bitmapOrg = BitmapFactory.decodeResource(this.getContext().getResources(), R.drawable.moon);Matrix matrix = new Matrix();matrix.postRotat...
分类:
移动开发 时间:
2014-12-10 12:14:14
阅读次数:
207
public abstract Resources getResources () Return a Resources instance for your application's package.BitmapFactoryextends Objectjava.lang.Object ? ...
分类:
移动开发 时间:
2014-12-10 10:40:13
阅读次数:
195
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
int searchPlateId = getActivity().getResources().getIdentifier("android:id/search_plate", null, null); View searchPlate = v.findViewById(searc...
分类:
其他好文 时间:
2014-12-03 07:02:20
阅读次数:
411
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
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。 主要有两种方法: (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
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