时间:12-12-24 栏目:android学习笔记 作者:魔豆先生 评论:0 点击: 8,469 次
ViewConfiguration.getScaledTouchSlop () 作用:是一个距离,表示滑动的时候,手的移动要大于这个距离才开始移动控件。
public void setCompoundDrawables (Drawable left, Drawable top, Drawable right, Drawable bottom)
Since: API Level 1
Sets the Drawables (if any) to appear to the left of, above, to the right of, and below the text. Use null if you do not want a Drawable there. The Drawables must already have had setBounds(Rect) called.
public void setCompoundDrawablesWithIntrinsicBounds (Drawable left, Drawable top, Drawable right, Drawable bottom)
Since: API Level 1
Sets the Drawables (if any) to appear to the left of, above, to the right of, and below the text. Use null if you do not want a Drawable there. The Drawables' bounds will be set to their intrinsic bounds.
翻译:
做了一个测试,大概推出这样的结论:
1、setCompoundDrawables 画的drawable的宽高是按drawable.setBound()设置的宽高,所以才有The Drawables must already have had setBounds(Rect) called.这句话之说。
2、setCompoundDrawablesWithIntrinsicBounds是画的drawable的宽高是按drawable固定的宽高,即通过getIntrinsicWidth()与getIntrinsicHeight()获得,所以才有The Drawables' bounds will be set to their intrinsic bounds.这句话之说!
声明: 本文由( 魔豆先生 )原创编译,转载请保留链接: 【Android】getScaledTouchSlop与setCompoundDrawables 函数的说明
Linux系统与内核学习群:194051772
WP建站技术学习交流群:194062106