clip.xml

<?xml version="1.0" encoding="utf-8"?>
<clip xmlns:android="http://schemas.android.com/apk/res/android"
android:clipOrientation="vertical"
android:drawable="@drawable/iii"
android:gravity="top" />

<ImageView
android:id="@+id/data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/clip" />

Java代码

final ClipDrawable draw = (ClipDrawable) imageView.getBackground();

draw.setLevel(draw.getLevel() + 1000);

注意: 默认的Level值是0,表示图片被这个裁剪,故图片是不可见的。当值达到10000是代码裁剪为0,图片可以完全显示。

最新文章

  1. 设计爬虫Hawk背后的故事
  2. 使用nodemailer发送邮件
  3. C# 字符串处理
  4. HDU4930 Fighting the Landlords 模拟
  5. 数据库的Instance/Crash Recovery
  6. 双击vbs时,默认cscript运行脚本
  7. SecureCRT远程控制ubuntu
  8. oracle手动启动服务
  9. git rev-list
  10. Spring MVC返回JSON数据
  11. ZOJ3228 - Searching the String(AC自动机)
  12. raw_input() 与 input()的区别
  13. BZOJ3394: [Usaco2009 Jan]Best Spot 最佳牧场
  14. 迁移到gitbook
  15. 简单的CSS网页布局--三列布局
  16. Jquery发送ajax请求以及datatype参数为text/JSON方式
  17. spring mvc ajax请求
  18. LeetCode -- Word Break 动态规划,详细理解
  19. 利用KindEditor实现公司通讯录的维护
  20. JavaScript保留关键字2。

热门文章

  1. cuda多线程间通信
  2. hdu-5491 The Next(贪心)
  3. 第15章 设备无关位图_15.1 DIB文件格式
  4. Thread对象的yield(),wait(),notify(),notifyall()
  5. IOS第四课——Autolayout_View
  6. $.data(data , &quot;&quot;)
  7. sql将同一个表中的两列Int数据相加,有些数据是空的
  8. JavaScript String 对象
  9. 转- android硬件传感器
  10. Java数据类型和变量