欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

listview里子項(xiàng)有按鈕的情況使用介紹

 更新時(shí)間:2013年03月05日 17:07:34   作者:  
不知大家有沒(méi)有遇到過(guò)listview里子項(xiàng)有按鈕的情況哈,本文自定義了按鈕并且在布局中做了引用,適合初學(xué)者哦,感興趣的也可以了解下
你自定義按鈕
復(fù)制代碼 代碼如下:

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);
}
}

然后在布局人間中這樣引用
復(fù)制代碼 代碼如下:

<your.name.customview.MyButton
android:id="@+id/mybutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>

相關(guān)文章

最新評(píng)論