android drawable setBounds()

来源:互联网 发布:佶天鸿淘宝店 编辑:程序博客网 时间:2024/05/18 01:07
/**     * Specify a bounding rectangle for the Drawable. This is where the drawable     * will draw when its draw() method is called.     */    public void setBounds(int left, int top, int right, int bottom) {}

一直以为setBounds的功能类似于canvas的clip, 是从drawable中截取bounds指定的一部分区域来进行显示(影响drawable的draw),

今天试了一把才发现,bounds并不是将某一区域截取,而是将drawable的整个部分都限制在了bounds规定的区域内,这样就可以实现缩放/扩大.


0 0
原创粉丝点击