Android5.X对图形操作上有更多的功能。下面来看看Tinting(着色)

Tinting的使用非常简单,几乎 没什么好说的,只要在xml中配置好tint和tintMode即可。直接看实际例子吧。

修改activity_main.xml代码如下:

 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"> <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
android:tint="@android:color/holo_blue_bright"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
android:tint="@android:color/holo_blue_bright"
android:tintMode="add"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
android:tint="@android:color/holo_blue_bright"
android:tintMode="multiply"/> <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
android:tint="@android:color/holo_blue_bright"
android:tintMode="screen"/> <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
android:tint="@android:color/holo_blue_bright"
android:tintMode="src_atop"/> <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
android:tint="@android:color/holo_blue_bright"
android:tintMode="src_over"/> <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
android:tint="@android:color/holo_blue_bright"
android:tintMode="src_in"/>
</LinearLayout>

就是将系统的一个亮蓝色用来给图片着色,黄块标注出来的代码就是不同的着色模式。我们看看都是啥样子的效果:

好像这几种模式也没有显著不同啊。最终出来的效果如上。

最新文章

  1. jsTree 的简单用法--异步加载和刷新数据
  2. ArcGIS Server发布服务,报错001270
  3. Java基础知识强化之IO流笔记64:合并流SequenceInputStream
  4. angularJS中如何写自定义指令
  5. Shell括号之间的区别
  6. 报错信息 The jsp:param action must not be used outside the jsp:include, jsp:forward, or jsp:params elements 的原因及解决办法
  7. 【64】Spring mvc详解
  8. C语言 汉诺塔问题
  9. $.ajax ,ajax请求添加请求头,添加Authorization字段
  10. BZOJ 3097: Hash Killer I
  11. mac 安装软件
  12. C#基础知识回顾-- 反射(2)
  13. MongoDB索引的种类与使用
  14. java获取取前段页面的参数
  15. [ActionScript 3.0] 透视投影
  16. scss-&amp;父选择器标识符
  17. php导出内容到txt并自动弹出下载文件
  18. Fedora桌面系统Idea中的部分中文无法显示解决
  19. 转:c++ Oracle OCCI 编程
  20. java算法之冒泡排序

热门文章

  1. Feathers JS – 基于 Express 构建数据驱动的服务
  2. Mobiles Wall – 致力于分享最优质的手机壁纸
  3. 第十二篇 SQL Server代理多服务器管理
  4. ASP.NET身份验证
  5. thread_LockSupport
  6. PHP入门:在Windows中安装PHP工作环境
  7. 解决SlidingMenu和SwipeBackLayout右滑事件冲突问题
  8. PowerShell与CMD在路径解析上的一点不同
  9. mongodb driver c#语法
  10. Oracle执行计划与统计信息的一些总结