【发布时间】:2011-07-27 15:39:11
【问题描述】:
我想创建一个扩展 Button 的按钮类。当我单击自定义按钮时,它会在其上方显示一个圆形,然后圆形消失。代码如下: 公共类 MyButton 扩展按钮 {
public GlowButton(Context context) {
super(context);
}
public GlowButton(Context context,AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean performClick() {
//Add the code for show the shape
return super.performClick();
}
} 这可能吗 ?我怎样才能在按钮上方创建形状? 提前谢谢!!
【问题讨论】:
-
为什么不直接使用九个补丁图形和切换按钮?
-
@trgraglia 谢谢,你能详细解释一下吗?形状比按钮大
-
另外,这只是一个按钮还是在列表中?如果它是一个按钮,我会选择下面的第一个答案,即仅更改圆形图像的可见性。如果您正在寻找动画,请查看动画。快速操作菜单是快速了解这一点的好方法。