首页 > 其他 > 详细

ImageButton按压效果失效

时间:2014-07-16 23:23:57      阅读:906      评论:0      收藏:0      [点我收藏+]

LinearLayout中ImageButton的按压效果不起作用,如图

bubuko.com,布布扣

布局如下:

<LinearLayout
  android:id="@id/ll_add_reply_face"
  android:layout_width="0dp"
  android:layout_height="wrap_content"
  android:layout_gravity="center_vertical"
  android:layout_weight="1"
  android:gravity="center"
  android:orientation="horizontal" >

  <ImageButton
    android:layout_width="35dp"
    android:layout_height="35dp"
    android:background="@drawable/selector_add_face"
    android:contentDescription="@string/btn_topic" />
</LinearLayout>

在Activity中LinearLayout有点击事件,此时点击LinearLayout区域但不在ImageButton区域中,此时有点击事件,如果点击ImageButton的区域,则ImageButton点击事件失效,但有点击效果。目标是点击LinearLayout区域时ImageButton都要有按压效果,并有点击事件,此时应该将ImageButton改为ImageView。

ImageButton按压效果失效,布布扣,bubuko.com

ImageButton按压效果失效

原文:http://www.cnblogs.com/chensuqian/p/3811308.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!