public class RoundButton
extends AppCompatButton
注意: 因为该控件的圆角采用 View 的 background 实现, 所以与原生的 android:background 有冲突。
android:background 指定 background, 该 background 不会生效。#setBackgroundResource(int) 等方法设置背景, 该背景将覆盖圆角效果。如需在 xml 中指定圆角、边框颜色、边框粗细、背景色等值,采用 xml 属性
如需在 Java 中指定以上属性, 需要通过 #getBackground() 获取 RoundDrawable 对象,
然后使用 RoundDrawable 提供的方法进行设置。
| Constructor and Description |
|---|
RoundButton(android.content.Context context) |
RoundButton(android.content.Context context,
android.util.AttributeSet attrs) |
RoundButton(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr) |