listview里子项有按钮的情况使用介绍
摘要:你自定义按钮:复制代码代码如下:publicclassMyButtonextendsButton{publicDontPressWithPa...
你自定义按钮:
复制代码 代码如下:
public class MyButton extends Button {
public DontPressWithParentImageView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public void setPressed(boolean pressed) {
// If the parent is pressed, do not set to pressed.
if (pressed && ((View) getParent()).isPressed()) {
return;
}
super.setPressed(pressed);
}
}
然后在布局人间中这样引用:
复制代码 代码如下:
<your.name.customview.MyButton
android:id="@+id/mybutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
【listview里子项有按钮的情况使用介绍】相关文章:
★ 基于Android AppWidgetProvider的使用介绍
★ android 字体颜色选择器(ColorPicker)介绍
★ ListView的Adapter使用 之 初学ArrayAdapter String
上一篇:
Android基站定位原理及实现代码