R.drawable.***中的文件是我们常用到的,不过有时候又没有直接的方法通过R文件获得图片,这时候就需要我们直接来转换一下了
下面提供四种方法给大家参考:
1、
Resources resources = mContext.getResources();
Drawable drawable = resources.getDrawable(R.drawable.***...
分类:
移动开发 时间:
2014-08-14 14:05:48
阅读次数:
192
1.首先在drawable文件夹中添加drawable文件checkbox_style.xml。[html] view plaincopy2.在values文件夹下的styles.xml文件中添加CustomCheckboxTheme样式。[html] view plaincopy3.在布局文件中使...
分类:
移动开发 时间:
2014-08-14 13:52:18
阅读次数:
185
xml控件配置属性android:background="@drawable/shape"标签corners ----------圆角gradient ----------渐变padding ----------内容离边界距离size ------------大小 solid ----------....
分类:
移动开发 时间:
2014-08-13 21:47:27
阅读次数:
273
逐帧动画与传统的卡通相似,也有点像gif。就是搞几张图片,根据顺序显示。
AnimationDrawable类可以用来创建一个新的表示为一个Drawable资源的逐帧动画,可以使用XML,在应用程序的res/drawable文件夹下讲动画Drawable资源定义为外部资源。
下面看程序和效果:
<animation-list xmlns:android="http://schemas.an...
分类:
其他好文 时间:
2014-08-13 01:20:54
阅读次数:
238
如何在Android中为TextView动态设置drawableLeft等两种方式:方式1:手动设置固有边界1 Drawable drawable = getResources().getDrawable(resId);2 //注意查看方法TextView.setCompoundDrawables(...
分类:
移动开发 时间:
2014-08-12 21:34:24
阅读次数:
379
Android中Bitmap, Drawable, Byte,ID之间的转化1. Bitmap 转化为 byte ByteArrayOutputStream out = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressForma...
分类:
移动开发 时间:
2014-08-12 18:20:44
阅读次数:
209
Xamarin.Forms 在启动的时候相当慢,必须添加一个启动界面,步骤如下:
1.将启动画面的图片命名为:splash_screen.png,并拷贝到 Resources 文件夹下的相应 Drawable 文件夹中;
2.在其中的 Drawable 文件夹下创建 splashscreen.xml ,内容为:
<bitmap xmlns:android="http://sch...
分类:
移动开发 时间:
2014-08-11 17:47:32
阅读次数:
231
渐变Drawable是使用标记作为形状Drawable定义...
分类:
移动开发 时间:
2014-08-09 18:53:28
阅读次数:
274
0.添加壁纸:在给系统换默认的壁纸的时候,需要修改一些地方:首先是默认的壁纸,这个是在framework中配置的,所以要修改framework中找到drawable-nodpi(这个文件夹中的内容都不会做缩放处理)中配置的一个叫做default_wallpapaer的壁纸.其次就是替换lanuche...
分类:
其他好文 时间:
2014-08-09 15:47:08
阅读次数:
219
Android Notification通知详解
Notification.Builder类中提供的方法:
builder.setAutoCancel(); 设置点击通知后,状态栏自动删除通知。
builder.setSmallIcon(R.drawable.alert); 设置通知小图标
builder.setLargeIcon(R.drawable.alert2); 设置通知大图标
builder.setContentTitle("标题"); 设置通知标题
builder.setContentText(...
分类:
移动开发 时间:
2014-08-09 11:39:17
阅读次数:
516