源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

listview里子项有按钮的情况使用介绍

  • 时间:2022-11-21 22:31 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:listview里子项有按钮的情况使用介绍
[b]你自定义按钮[/b]:
[u]复制代码[/u] 代码如下:
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); } }
[b]然后在布局人间中这样引用[/b]:
[u]复制代码[/u] 代码如下:
<your.name.customview.MyButton android:id="@+id/mybutton" android:layout_width="wrap_content" android:layout_height="wrap_content" />
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部